For $x \in [-1,1]$ and $0 \le g < 1$, consider the convergent series $$ H(x,g) = \sum_{k = 0}^\infty (2k+1) g^k P_k(x)^2 $$ where $P_k$ is the $k$-th Legendre polynomial. Then $H(1,g) = \frac{1+g}{(1-g)^2}$, and numerical evidence suggests that $H(0,g) \sim \frac{2}{\pi(1-g)}$ as $g \to 1$.
Is this correct? Is this known? Is anything known about the function $H$?
This is correct and known. In fact one has (formula 5.10.2.1 from Vol. II of Prudnikov-Brychkov-Marychev) $$\mathcal{F}(t,y,z):=\sum_{k=0}^{\infty}t^k P_k(\cos y)P_k(\cos z)=\frac{4}{\pi(u_++u_-)}\mathbf{K}\left(\frac{u_+-u_-}{u_++u_-}\right),$$ where $u_{\pm}=\sqrt{1-2t\cos(y\pm z)+t^2}$ and $\displaystyle\mathbf{K}(k)=\int_0^{\pi/2}\frac{dx}{\sqrt{1-k^2\sin^2 x}}$ denotes the complete elliptic integral of the first kind.
The sum to be calculated is then given by \begin{align}H(x,g)&=\left[\left(2t\frac{d}{dt}+1\right)\mathcal{F}(t,y,y)\right]_{t=g,\cos y=x}=\\ &=\frac4{\pi}\left(2g\frac{d}{dg}+1\right)\frac{1}{v(x,g)+1-g}\mathbf{K}\left(\frac{v(x,g)-1+g}{v(x,g)+1-g}\right), \end{align} where $v(x,g)=\sqrt{(1+g)^2-4gx^2}$. After differentiation we obtain somewhat cumbersome expression
\begin{align} H(x,g)=&\frac{2(1+g)(1-g+v(x,g))}{\pi (1-g)v^2(x,g)}\mathbf{E}\left(\frac{v(x,g)-1+g}{v(x,g)+1-g}\right)+\\ +&\frac{(1+g)(1-g-v(x,g))}{\pi g(1-x^2)v(x,g)}\mathbf{K}\left(\frac{v(x,g)-1+g}{v(x,g)+1-g}\right), \end{align} where $\displaystyle\mathbf{E}(k)=\int_0^{\pi/2}\sqrt{1-k^2\sin^2 x}\,dx$ denotes complete elliptic integral of the second kind.
Now the exact expression $$H(0,g)=\frac{4\mathbf{E}(g)}{\pi(1-g^2)}-\frac{2\mathbf{K}(g)}{\pi},$$ and $\mathbf{E}(1)=1$ imply the asymptotics conjectured in the question.