I have long been uncomfortable with how numbers in alternative bases are expressed. Alternative bases are marketed as transcending our arbitrary base-$10$ conventions, but I wonder if they really succeed.
If we write the expression $31_5$, the $31$ is in base-$5$, while the $5$ is presumably in base-$10$, an unfortunate asymmetry. If history had unfolded differently, the base itself would be written in a different base. Likewise for that base, and so on recursively. The cardinality of the multiset $\{m,\ a,\ t,\ h,\ m,\ a,\ t,\ h,\ m,\ a,\ t,\ h,\ m,\ a,\ t,\ h,\ m\}$ is $17_{(10_{(10_{(10_{(10_{(10_{(10_{(10_{...})})})})})})})}$. It is possible to just reference the cardinality of the multiset directly to avoid this infinite recursion, or to truncate the chain at any point, i.e., $17_{(10_{(10_{card\{m,\ a,\ t,\ h,\ m,\ a,\ t,\ h,\ m,\ a\}})})}$.
To capture the advantages of positional notation, the same quantity could be represented as $$card\{m,\ a,\ t,\ h,\ m,\ a,\ t\}card\{m,\ a,\ t,\ h,\ m,\ a,\ t,\ h,\ m,\ a\}^{card\{\}} + card\{m\}card\{m,\ a,\ t,\ h,\ m,\ a,\ t,\ h,\ m,\ a\}^{card\{m\}}$$
Decimal users can read this as $7 * 10^0 + 1 * 10^1$ but without the recursion problem implicit in each of these digits.
Another representation would be $$card\{m,\ a\}card\{m,\ a,\ t\}^{card\{\}} + card\{m,\ a\}card\{m,\ a,\ t\}^{card\{m\}} + card\{m\}card\{m,\ a,\ t\}^{card\{m,\ a\}}$$
This is secretly ternary; $2 * 3^0 + 2 * 3^1 + 1 * 3^2$.
How can I convert a representation purely in terms of cardinalities like these into a natural number of the form $n_b$, in such a manner that the base of $n$, the base of $b$, the base of the base of $b$, and so on recursively, are written in a shared base other than decimal, as if history had truly unfolded differently, and there wasn't any decimal presumption to fall back on under the hood?
One thing you can do is write the base subscript in tick notation (often called "unary," even though that's a clear abuse of terminology): e.g. $$17_{''''''''}$$ is uniquely interpretable as (in our base-ten notation) $1\cdot 8+7\cdot 1$. What base the reader is taking as default will not affect their ability to count the number of ticks indicating the intended base.
Of course this quickly becomes unreadable. We can make things nicer by mixing in arithmetic operations, e.g. $$17_{('')\cdot (('')+(''))}.$$ And in the other direction, if we're worried about what arithmetic operations are taken as basic ("what if we're communicating with aliens who don't know what multiplication is?"), then we can express everything in this tick notation. Ultimately, every "basic" arithmetical operation can be built up from successor (which is basically what tick notation is) and (primitive) recursion.