Mathematical side of the problem
Given the metric $$ds^2 = dr^2+r^2d\theta^2+r^2\sin^2\theta d\varphi^2$$ we can easily construct the action of a free particle $$S=\alpha \int d\tau \underbrace{\sqrt{\dot{r}^2 + r^2 \dot{\theta}^2+r^2\sin^2\theta \dot{\varphi}^2}}_{:=L},\quad \text{where}\quad \dot{\vphantom{r}}:=\frac{d}{d\tau}.$$ Consider now the following action $$\bar{S} := \alpha \int f(L)d\tau, $$ where $f$ is an arbitrary smooth function.
For the specific case $f(g)=g^2/2$ one can show that the resulting equations of motion will describe the same curve, see this Math.SE answer and this Phys.SE post.
My question is now if one can generalize this to an arbitrary smooth function $f$? For example, $f(g)=g^2$ seems to work just as well.
Physic's problem
Even if the above works out form the mathematical side, I'm still confused on why we are allowed to do this in a physics context. The Lagragian is a well defined property for a given physical system, as well as the action. Why can I just square the Lagragian and still get something physically meaningful? What about the parametrization of time? If I change the parametrization, form lets say the eigentime to some arbitrary frame, what happens then to the equations of motion when such a function $f$ is involved?