bpo-42133: update parts of the stdlib to fall back to `__spec__.loader` when `__loader__` is missing (#22929)

6 files changed