Another method that would also shorten the string would be to calculate the md5/sha1 hash of the string (concatenated with a seed if you wished):
import hashlib
>>> hashlib.sha1("12234_1_Hello'World_34433_22acb_4554344_accCC44").hexdigest()
'e1153227558aadc00a2e90b5013fdd6b0804fdfb'
In theory you should get a set of strings with very few collisions and with a fixed length. The hashlib
library has an array of different hash functions you can use in this manner, with different output sizes.
Edit: You also said that you needed a reversible string, so this wouldn't work for that. Afaik, however, many web platforms that use clean URLs like you seem to want to implement use hash functions to calculate a shortened URL and then store that URL along with the page's other data to provide the reverse lookup capability.