We know that Symmetry of the Lagrangian ($\delta L = 0$) always yields some conservation law.
Now, if $\delta L \neq 0$, that doesn't mean we won't have conservation law, because if we can show action is invariant, we can still get what gets conserved.
Let's look at this answer, I don't get the following.
He mentions that we have:
\begin{equation} \frac{\partial L}{\partial q}K + \frac{\partial L}{\partial \dot{q}}\dot{K} = \frac{dM}{dt}. \end{equation}
To me, what $M$ represents to me is a total time derivative of some function $M$, so if we show that $L' = L + \frac{d}{dt}M$, we got action invariance and we will get something to be conserved.
The question is the author of the answer mentions that $M$ can be a function of $q, \dot q, t$ (note $\dot q$). I mean how can it be a function of $\dot q$?
In more detail: We know that action stays invariant if $L$ is changed by $\frac{d}{dt} M(q,t)$ when $M$ is a function of $q, t$, but if it's a function of $\dot q$, action won't stay invariant. Even in textbooks, I never saw such $M$ to be mentioned to be containing $\dot q$. Even Landau says the following: Check here. Could you shed some lights?