Python 3.9 is now generally available.

google.appengine.api.datastore_types.ValidateStringLength

Raises an exception if the supplied string is too long.

name Name of the property this is for.
value String value.
max_len Maximum length the string may be.

OverflowError if the value is larger than the maximum length.