[3.10] bpo-44246: Restore compatibility in entry_points (GH-26468) (GH-26471)



* [bpo-44246](): Entry points performance improvements.

From importlib_metadata 4.3.1.

* [bpo-44246](): Sync with importlib_metadata 4.4
(cherry picked from commit c34ed08d975fb7daa7b329f7c631647782290393)


Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

Automerge-Triggered-By: GH:jaraco
3 files changed