Anyone storing them in a DB, or using them in internal fields will likely have a surprise on their hands. Unless they store them as opaque strings anyway, which is the saner thing to do in these situations anyway.

SQL requires setting the max length of a string, and its quite reasonable to set it to len(2147483647)=10 if you were expecting 32-bit int IDs.

If your goal is storing opaque strings, that is a very silly thing to do.

At that point you’re just blowing up storage for no reason. Just use an int if you’re that sure.

Setting a string length to coincidentally the length of a int serialized to a string while doing no other validation on it is…. Just special.