It’s not GitHub’s fault the DMCA exists
They could have froze and privated the repo and investigated the issue.
This isn't the same as a pirated move or song on YouTube. This is code. And version control or code repos are very important.
Even if I'm wrong, this is a valid way to dos my repo. Like when it happens on YouTube people loose money right and that's some people's main income. This can be even worse.
If you aren't okay with that, use a service provider in a jurisdiction not governed by DMCA laws, or run your own service provider and take on that liability yourself.