pathlib.Path.glob() calls os.scandir() under the hood, converting os.DirEntry objects to path objects using a private _make_child_relpath() method. This builds a child path from a given basename. The basename is obtained from the dir entry's name attribute.
I've just spotted (or realised) that dir entries have a path attribute that we could use, rather than constructing our own string path from the basename. This seems to be a fair bit faster in my testing.
Linked PRs