Avoid OOM in doctest CI
# What does this PR do?

This is done by inject `gc.collect()` to the source code during pytest/doctest collecting the test to run.
_The documentation is not available anymore as the PR was closed or merged._<|||||>Update: after a correction, only 30 minutes longer or a bit more.

The job runs 2x slower ...<|||||>Running the whole doctest: No more OOM. Only one test failure (lucky!)

Tag @sgugger so we can have doctest run until @Rocketknight1 have a complete solution in #24146.
(We haven't received any doctest report for 2 weeks)