This is a straight copy&paste from the Python source itself for version 2.7. So I would not modify it. Also in all of our cases we will not have any string longer then a couple of chars. So I don't think that this should block us.