GitLab also has to comply with DMCA complaints. A quick search brought up their procedure: https://about.gitlab.com/handbook/engineering/security/opera...
They'll still take down a repo and block the user if it is hosted. And self hosting something isn't free, plus quite possibly puts more legal exposure on the team.
This isn't a problem with technologies or the platform. There fundamentally needs to be a narrowing of DMCA, a presumption of innocence rather than guilt, and penalties for issuing unjustified takedowns.