Git hooks are client-side or server-side. Please note that
It’s important to note that client-side hooks are not copied when you
clone a repository. If your intent with these scripts is to enforce a
policy, you’ll probably want to do that on the server side source
The distinction is based on the type of operation being performed:
Client-side hooks are triggered by operations such as committing and
merging, while server-side hooks run on network operations such as
receiving pushed commits.
pre-commit hooks are client-side, thus not clonable as you correctly state. I find this discussion on why that would also be a large security risk.
However, regarding PEP8 I believe this page is holding the answer. The pre-commit scripts are created locally from the repository on your machine (and, of course, can be bypassed).