Функция intern(s)
может делать то, что вы хотите:
>>> help(intern)
Help on built-in function intern in module __builtin__:
intern(...)
intern(string) -> string
``Intern'' the given string. This enters the string in the (global)
table of interned strings whose purpose is to speed up dictionary lookups.
Return the string itself or the previously interned string object with the
same value.
>>>