<div dir="ltr">I came up with a solution that I think will work however I am not aware of its side-effects. If you know any of its side-effects, then please let me know.<br><br>
<style type="text/css">p, li { white-space: pre-wrap; }</style>
<p style="margin: 0px; text-indent: 0px;">\documentclass{minimal}</p>
<p style="margin: 0px; text-indent: 0px;">\makeatletter</p>
<p style="margin: 0px; text-indent: 0px;">\let\orig@mathbf\mathbf</p>
<p style="margin: 0px; text-indent: 0px;">\DeclareMathAlphabet {\new@mathbf}{OT1}{cmtt}{m}{n}</p>
<p style="margin: 0px; text-indent: 0px;">\renewcommand{\mathbf}[1]{\expandafter\@math@bf #1@}</p>
<p style="margin: 0px; text-indent: 0px;">\newcommand{\@math@bf}[1]{%</p>
<p style="margin: 0px; text-indent: 0px;"> \ifx @#1% then terminate</p>
<p style="margin: 0px; text-indent: 0px;"> \else</p>
<p style="margin: 0px; text-indent: 0px;"> \ifx0#1\new@mathbf{0}\else\ifx1#1\new@mathbf{1}\else\ifx2#1\new@mathbf{2}\else\ifx3#1\new@mathbf{3}\else\ifx4#1\new@mathbf{4}\else\ifx5#1\new@mathbf{5}\else\ifx6#1\new@mathbf{6}\else\ifx7#1\new@mathbf{7}\else\ifx8#1\new@mathbf{8}\else\ifx9#1\new@mathbf{9}\else\orig@mathbf{#1}\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi</p>
<p style="margin: 0px; text-indent: 0px;"> \expandafter\@math@bf</p>
<p style="margin: 0px; text-indent: 0px;"> \fi</p>
<p style="margin: 0px; text-indent: 0px;">}</p>
<p style="margin: 0px; text-indent: 0px;">\makeatother</p>
<p style="margin: 0px; text-indent: 0px;">\begin{document}</p>
<p style="margin: 0px; text-indent: 0px;">$\mathbf{0s12s3xyz09876\alpha01234xyz}$</p>
<p style="margin: 0px; text-indent: 0px;">\end{document}</p><br></div>