The lcc lower-case-code method is a lookup.
An expl3 lookup method could be used.
Here, a token-list mapping function as proof-of-concept:

A key-value property-list could also be used in expl3, as an alternative.
Much patience needed, to set up every symbol (and operator).
MWE
\documentclass{article}
\usepackage{xcolor}
\usepackage{unicode-math}
\setmathfont{TexGyrePagella-Math}
\usepackage{xparse}
\ExplSyntaxOn
\cs_new:Npn \sym_to_col:n #1
{
\tl_set:Nn \l_tmpb_tl { #1 }
\str_case:VnTF
\l_tmpb_tl
{
{ 𝒚 } { {\color{red} 𝒚 } }
{ + } { {\color{green} + } }
{ m } { { {\colorbox{blue}{\color{yellow} $m$} } } }
{ n } { {\color{blue} n } }
{ ( } { {\color{brown} ( } }
{ ) } { {\color{brown} ) } }
{ 𝒯 } { {\color{violet} 𝒯 } }
}
{ } % true
{ #1 } % false
}
\NewDocumentCommand \colourmaths { m } {
\tl_set:Nn \l_tmpa_tl { #1 }
\if_mode_math:
\tl_map_function:NN
\l_tmpa_tl
\sym_to_col:n
\else:
\tl_use:N \l_tmpa_tl
\fi:
}
\prop_gset_from_keyval:Nn \g_tmpa_prop
{
𝒚=blue,
}
\ExplSyntaxOff
\begin{document}
Text mode:
abc \colourmaths{mno}
\bigskip
Math mode:
$xyz = \colourmaths{𝒚mn+qrs(0)𝒯}$
\end{document}
\setmathfont
one glyph at a time to individualize colour etc. If\setmathfont
is called more than a handful of times, the symbol font limit is exceeded; hence the source does not compile. If unicode-math wants to allow dozens of characters to be customized, one\setmathfont
by one, I will happily submit a bug. Unicode-math continues to be my favourite package, with its prints all over documents like dropbox.com/s/m95ta9o6ac0l8wg/Project1Report_BenBarlow.pdf?dl=0