avoid overflow (or auto conversion to long) in Python version of the t1 decoder/encoder