[Debug] enhance perf of DebugClassLoader
bug #10861 [Debug] enhance perf of DebugClassLoader (nicolas-grekas)

This PR was merged into the 2.3-dev branch.

Discussion
----------

[Debug] enhance perf of DebugClassLoader

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #10860
| License       | MIT
| Doc PR        | none

- restricts the check for case mismatch to Windows and Darwin,
- on Darwin, use glob() trick to bypass more extensive checks

Commits
-------

485e047 [Debug] enhance perf of DebugClassLoader