For a custom encoding using URL fragment-safe characters, you can go beyond Base64.
Considering alphanumeric characters (A-Z, a-z, 0-9), which give you 62 characters,
and adding safe special characters like:
-_.~!$&'()*+,;=:@?/#[]
(which are 22 in total), you can potentially reach a base count of around 84 (62 + 22).
This would be a custom base-84 encoding, utilizing these URL-safe characters to maximize space efficiency.