Tension in the simple pendulum (polar coordinates)

Let's consider the simple pendulum as is displayed here or over there (page 10). The analysis of the second Newton's law in polar coordinates goes as follows:

$$\vec{F} = m\frac{d^2\vec{r}}{dt^2}, \\ F_r \hat{r} + F_\theta \hat{\theta} = m\frac{d^2 (r\hat{r})}{dt^2} , \\ F_r \hat{r} + F_\theta \hat{\theta} = m(\ddot{r} - r\dot{\theta}^2) \hat{r} + m(r\ddot{\theta} + 2\dot{r}\dot{\theta}) \hat{\theta} , \\ F_r \hat{r} + F_\theta \hat{\theta} = ma_r \hat{r} + m a_\theta \hat{\theta} .$$

Substituing the forces we get,

$$-T + mg\cos(\theta) = ma_r = m(\ddot{r} - r\dot{\theta}^2) , \\ -mg\sin(\theta) = ma_\theta = m(r\ddot{\theta} + 2\dot{r}\dot{\theta})$$

Considering the restrictions $r = L$ and $\dot{r} = \ddot{r} = 0$ we get

$$-T + mg\cos(\theta) = m(- L \dot{\theta}^2) , \\ -mg\sin(\theta) = m(L\ddot{\theta})$$ The second one is the known pendulum equation $$\ddot{\theta} + \frac{g}{L}\sin(\theta) = 0 ,$$ while the first one is a much less used equation $$T = mL \dot{\theta}^2 + mg\cos(\theta)$$ ¿Is it the correct equation to calculate the tension? Note that this implies that $a_r \neq 0$; which in words means that the radial acceleration is different from zero which looks unphysical, ¿where is the trick? ¿Has it something to do with noninertial forces?

Yes this is the correct equation for $T$ and yes $a_r \neq 0$. In fact $$a_r = -L \dot{\theta}^2$$
The particle must accelerate in the normal direction in order to track a radial path. If $a_r=0$ then the path would be a straight line.