LaTeX lets you declare more than 16 math fonts.
You can declare more than 16
\DeclareMathAlphabet
but they will only be allocated and take up one of the 16 fonts if they are actually used
in a document. So you can have a package that declares fraktur and script and bold italic and .... and unless a user actually tries uses them all in the same document it is OK.
The allocation of symbol fonts is different. For efficiency reasons they are allocated as they are declared so that the numerical value 0-16 can be used when defining characters.
So one way to get the most fonts into a math version is not to use math alphabets
just use the 16 families for symbol fonts. Then use \textit rather than \mathit
and similarly define \text.. versions for any other math alphabets that you need,
\textit and \mathit use the same font but the former accesses the font via text mode and so does not use up one of the 16 math groups.
Alternatively of course one could use xelatex or lulatex where each font can have a million characters, up from 256 and you can have 256 of them in each math list, up from 16, so it's a lot less likely that you run out of slots.
If you are using xetex or luatex you can use 256 rather than 16 slots. You can only
use \mathchardef with the first 16 slots so it is best to restrict \DeclareSymbolFont to that range, but math alphabets can use the full range.
This document has 17 math alphabets in addition to the standard symbol fonts, so 20 or so in all.

The redefinitions between \makeatletter and \makeatother below are not needed in LaTeX releases from 2015 onwards.
New LaTeX formats detect xetex or luatex and allow the 256 math alphabets
without needing any extra definitions.
\makeatletter
\ifx\e@alloc\@undefined
\def\new@mathgroup{\alloc@8\mathgroup\chardef\@cclvi}
\let\newfam\new@mathgroup
\fi
\def\select@group#1#2#3#4{%
\ifx\math@bgroup\bgroup\else\relax\expandafter\@firstofone\fi
{%
\ifmmode
\ifnum\csname c@mv@\math@version\endcsname<256 %\sixt@@n
\begingroup
\escapechar\m@ne
\getanddefine@fonts{\csname c@mv@\math@version\endcsname}#3%
\globaldefs\@ne \math@fonts
\endgroup
\init@restore@version
\xdef#1{\noexpand\use@mathgroup\noexpand#2%
{\number\csname c@mv@\math@version\endcsname}}%
\global\advance\csname c@mv@\math@version\endcsname\@ne
\else
\let#1\relax
\@latex@error{Too many math alphabets used in
version \math@version}%
\@eha
\fi
\else \expandafter\non@alpherr\fi
#1{#4}%
}%
}
\def\document@select@group#1#2#3#4{%
\ifx\math@bgroup\bgroup\else\relax\expandafter\@firstofone\fi
{%
\ifmmode
\ifnum\csname c@mv@\math@version\endcsname<256 %\sixt@@n
\begingroup
\escapechar\m@ne
\getanddefine@fonts{\csname c@mv@\math@version\endcsname}#3%
\globaldefs\@ne \math@fonts
\endgroup
\expandafter\extract@alph@from@version
\csname mv@\math@version\expandafter\endcsname
\expandafter{\number\csname
c@mv@\math@version\endcsname}%
#1%
\global\advance\csname c@mv@\math@version\endcsname\@ne
\else
\let#1\relax
\@latex@error{Too many math alphabets used
in version \math@version}%
\@eha
\fi
\else \expandafter\non@alpherr\fi
#1{#4}%
}%
}
\def\DeclareSymbolFont#1#2#3#4#5{%
\@tempswafalse
\edef\reserved@b{#2}%
\def\cdp@elt##1##2##3##4{\def\reserved@c{##1}%
\ifx\reserved@b\reserved@c \@tempswatrue\fi}%
\cdp@list
\if@tempswa
\@ifundefined{sym#1}{%
%% only allow symbol fonts below 16
\ifnum\count18<15 %
\expandafter\new@mathgroup\csname sym#1\endcsname
\expandafter\new@symbolfont\csname sym#1\endcsname
{#2}{#3}{#4}{#5}%
\else
\@latex@error{Too many symbol fonts declared}\@eha
\fi
}%
{%
\@font@info{Redeclaring symbol font `#1'}%
\def\group@elt##1##2{%
\noexpand\group@elt\noexpand##1%
\expandafter\ifx\csname sym#1\endcsname##1%
\expandafter\noexpand\csname#2/#3/#4/#5\endcsname
\else
\noexpand##2%
\fi}%
\xdef\group@list{\group@list}%
\def\version@elt##1{%
\expandafter
\SetSymbolFont@\expandafter##1\csname#2/#3/#4/#5\expandafter
\endcsname \csname sym#1\endcsname
}%
\version@list
}%
\else
\@latex@error{Encoding scheme `#2' unknown}\@eha
\fi
}
\makeatother
\documentclass{article}
\usepackage{amsfonts,amssymb}
\usepackage[mathscr]{euscript}
\DeclareSymbolFont{bsymbols} {OMS}{cmsy}{b}{n}
\DeclareMathAlphabet{\mathrs}{U}{rsfso}{m}{n}
\DeclareMathAlphabet{\mathbbx}{U}{bbold}{m}{n}
\DeclareMathAlphabet{\mathbit}{OT1}{cmr}{bx}{it}
\DeclareMathAlphabet{\mathbsf}{OT1}{cmss}{bx}{n}
\DeclareMathAlphabet{\mathtm}{OT1}{ptm}{m}{n}
\DeclareMathAlphabet{\mathbtm}{OT1}{ptm}{bx}{n}
\DeclareMathAlphabet{\mathdh}{OT1}{cmdh}{m}{n}
\begin{document}
$
1+2\left(\sum\limits_0^nx_i\right\}
A
\mathit{A}
\mathbit{A}
\mathtt{A}
\mathsf{A}
\mathbsf{A}
\mathrm{A}
\mathbf{A}
\mathscr{A}
\mathbb{A}
\mathbbx{A}
\mathcal{A}
\mathfrak{A}
\mathrs{A}
\mathtm{A}
\mathbtm{A}
\mathdh{A}
$
\end{document}
\boldmathrather than\bm. The latter is not a change of mathversion. – Mar 11 '15 at 17:50boldmathversion (\boldmath) butbmcopies the fonts from the bold math version into the standard one so that you don't have to change math versions, but it is very susceptible to hitting the 16 limit. – David Carlisle Mar 11 '15 at 17:58\DeclareSymbolFont,DeclareMathVersion,...) you might have to overcome that hurdle as well. – Mar 11 '15 at 18:09