Here I redefine \texttt to make ' active and replace itself with \textquotesingle. The original definition is saved in \svtexttt.
EDITED to return ' to non-active status at the conclusion of a \texttt.
REEDITED to use letltxmacro, per egreg's suggestion.
REREEDITED to restore the originally defined ' after \texttt usage, so as not to interfere with math conversion to \prime (hat tip/mumbled curse to David).
\documentclass{article}
\usepackage{textcomp,lmodern,letltxmacro}
\LetLtxMacro{\svtexttt}{\texttt}
\catcode`'=\active %
\let\svprime'
\renewcommand\texttt{\catcode`'=\active \def'{\textquotesingle}\textttaux}
\newcommand\textttaux[1]{\svtexttt{#1}\gdef'{\svprime}\catcode`'=12 }
\catcode`'=12 %
\begin{document}
\svtexttt{That's life!}
versus
\texttt{That's life!}
Is ' active? No.
Testing prime: $x' =dx/dt$
\end{document}

\texttt)? I've posted an answer to elaborate on this observation. – Mico Jun 13 '18 at 20:06