In my classical electrodynamics class, we use the Lagrangian of the relativistic free massive particle as $$L = - mc\sqrt{\dot{r}\cdot\dot{r}}.$$ Where $\dot{r}^\mu = u^\mu = \frac{dr^\mu}{d \tau}$; $r^\mu = (ct, x, y, z)^\mu$; $\tau$ is the proper time; and we use the $(+,-,-,-)$ sign convention for the metric.
This recovers all of the correct equations of motion provided we only use the fact that $\dot{r}\cdot\dot{r} = c^2$ after we have applied Lagrange's equations of motion. This would make sense if the fact that $\dot{r}\cdot\dot{r} = c^2$ was a consequence of Lagrange's equations (as we always let the Lagrangian tell us the equations of motion, and never substitute them back into the Lagrangian). However, as far as I can see $\dot{r}\cdot\dot{r} = c^2$ is not a consequence of Lagrange's equations, it's just always true.
I believe $\dot{r}\cdot\dot{r} = c^2$ follows immediately from the definition of $\dot{r}$. I must be wrong?