TeX allows one to say
$a+{\fam4 x}$
which will print a in the default math italic and x in the font assigned to math family 4. In plain TeX such assignments are static and family 4 is assigned the text italic font.
In LaTeX the assignments are dynamic, depending on the document and the math font package loaded. So one doesn't know in advance what family is assigned the boldface font; the assignment is made once and for all when the first \mathbf command is performed. This is in common with all macros defined with \DeclareMathAlphabet.
LaTeX also calls \family in a different way, namely \mathgroup; they are synonyms.
You could do
\AtBeginDocument{%
\sbox0{$\mathbf{\xdef\mathbfgroup{\the\mathgroup}}$}%
}
and the macro \mathbfgroup will hold the math group (family) number corresponding to \mathbf.
However, doing also \everymath{\mathgroup\mathbfgroup} will make all letters in math to appear boldface, together with numbers. This is definitely not what you want, I believe.
Example code.
\documentclass{article}
\AtBeginDocument{%
\sbox0{$\mathbf{\xdef\mathbfgroup{\the\mathgroup}}$}%
\everymath{\mathgroup\mathbfgroup\relax}%
}
\begin{document}
$2v+cw=u$
\end{document}

As you see, you cannot distinguish between vectors and scalars; the correct formula should be typeset as
$\mathrm{2}v+\mathnormal{c}w=u$
and I'm very dubious whether you really want to do it.
Define a macro for vectors, such as
\newcommand{\vv}[1]{\mathbf{#1}}
and type in your formula as
$2\vv{v}+c\vv{w}=\vv{u}$
The input is clearer and you can redefine \vv at will, in case you decide that, after all, vectors should be boldface italic.
If you really want all letters in math to be boldface by default, the strategy is
\DeclareSymbolFont{boldfaceletters}{OT1}{cmr}{bx}{n}
\DeclareSymbolFontAlphabet{\mathbf}{boldfaceletters}
\DeclareMathSymbol{a}{\mathalpha}{boldfaceletters}{`a}
[...all letters...]
\DeclareMathSymbol{z}{\mathalpha}{boldfaceletters}{`z}
\DeclareMathSymbol{A}{\mathalpha}{boldfaceletters}{`A}
[...all letters...]
\DeclareMathSymbol{Z}{\mathalpha}{boldfaceletters}{`Z}
with perhaps also the uppercase Greek, depending on your preferences. You can use \mathnormal or the other similar commands to change the shape.
\mathgroupis a synonym for\family. You definitely don't want to do like that, anyway. Define\vvto mean\mathbf(or whatever) and use\vv{a}\cdot\vv{b}. You don't want that$2x$has a boldface “2”, do you? – egreg Feb 19 '17 at 17:20if-elsestructure to filter only alphabets? Just works whenever the object is A-Z and a-z. – Eric Feb 19 '17 at 17:29\displaystylein\everymath– David Carlisle Feb 19 '17 at 17:36\mathgroupis the LaTeX name for the\famprimitive. Keep in mind, however, that LaTeX2e adds the complexity of dynamic font allocation. – GuM Feb 19 '17 at 19:23