Edit: Thanks for your kind comments on disabling contributions. I’m aware of the possibility, this is just a meme.
Contributions in open source projects are great, needed and make the world a better place after all. Therefore they should be declined politely, optionally by giving a reason.
I hereby inform you that I will no longer accept contributions to this post /s.


You can disable issues if you want:
https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/disabling-issues
I had to do that on a corpo repo to proprietary BS once. It works.
PRs are similar. Just dont allow it and put the rules as such. Or make the repo private. Or even better, self host ;)