[3.10] bpo-44298: Backport #26513 to 3.10 (#26516)

* Backport 937cebc93 to 3.10

* Update importlib
4 files changed