Fix remote execution fails when using 'pre-commit'
A bug was found causing CI fails to external repos attempting to incorporate pre-commit. Examples: toolchain_utils, ape, download_utils.
All failing with the same error: ModuleNotFoundError: No module named 'pydantic_core._pydantic_core'.
It is suspected that this piece of code is the culprit.
We need to reproduce the bug in the remote execution of this repo (pre-commit) to prevent regressions.
Edited by Tomer Shterenberg