Automatically prevent extra line spacing because of math

Here's a luatex version that could be made more robust but after the linebreaking it uses a callback to set the height and depth of boxes and (s) replace any baselineskip or lineskip glue by a fixed value. (Probably it should preserve the height of the first box and the depth of the last, left as an exercise..

enter image description here

\documentclass{article}

\usepackage{mathtools}

\DeclareMathOperator\Ad{Ad}


\directlua{
function fixlines(h,c)
local pd=0
print('code: ' .. type(c) .. ':' .. c)
for n in node.traverse(h) do
%
% smash boxes
if n.id==0 then
 n.depth=0
 n.height=0
end
%
% lineskip or baselineskip set to 12pt
if n.id==12 and (n.subtype==1 or n.subtype==2) then
n.width=786432 % 12pt in sp
end
end
return h
end
luatexbase.add_to_callback('post_linebreak_filter', fixlines, 'fix line spacing')
}
\usepackage{lipsum}

\begin{document}


Consider the map~$\Ad_{g_0^2}$.
La la la la la la la la la la la la la la la la la.
And the algebra~$\widetilde{A}$.
\lipsum[1]

Consider the map~\smash{$\Ad_{g_0^2}$}.
La la la la la la la la la la la la la la la la la.
And the algebra~\smash{$\widetilde{A}$}.
\lipsum[1]

\end{document}

Posting a second answer as I got drawn back to this page by a comment ping and I see that there is only a luatex answer when a simpler classic tex answer is possible.

If you set \lineskiplimit=-\maxdimen then tex will preserve baseline with no limit on the amount of overlapping that would cause.

enter image description here

\documentclass{article}

\usepackage{mathtools}

\DeclareMathOperator\Ad{Ad}

\usepackage{lipsum}

\begin{document}

\lineskiplimit=-\maxdimen

Consider the map~$\Ad_{g_0^2}$.
La la la la la la la la la la la la la la la la la.
And the algebra~$\widetilde{A}$.
\lipsum[1]

Consider the map~\smash{$\Ad_{g_0^2}$}.
La la la la la la la la la la la la la la la la la.
And the algebra~\smash{$\widetilde{A}$}.
\lipsum[1]

\end{document}