Hmm, looking at python's base64.urlsafe_b64encode(s), padding is still used. So it sounds like it doesn't fully implement the "modified Base64 for URL" spec.
Base64 encoding also seems to result in quite long ascii strings compared to what I threw together.
Or is there a way to use Base64 which would give results of a comparable length?