Python 3.9 is now generally available.

google.appengine.ext.db.allocate_ids_async

Asynchronously allocates a range of IDs.

Identical to allocate_ids() except returns an asynchronous object. Call get_result() on the return value to block on the call and return the result.