Convert to and from Base 94
Haskell, 42 + 31 = 73 bytes

To base 94: 42 bytes



(l!!)
l="":tail[s++[c]|s&lt;-l,c&lt;-['!'..'~']]


Try it online!

Instead of using modular arithmetic, we generate the list l of all strings in the desired order and index into it.

The recursive definition of l is similar to this one for generating all strings, but modified to output strings in the desired order by appending the new character, and with a tail to prevent the analogue of leading zeroes.

From base 94: 31 bytes



foldl(\n-&gt;(94*n-33+).fromEnum)0


Try it online!

Iterates over the characters c of the string, updating the current value n to 94*n-33+fromEnum c.