Such an anonymous mode would be damaging for GitHub because it needs to stay friendly with its commercial and corporate customers. Besides, such a mode only provides obfuscation, but no legal protection at all. In fact, lawyers would turn it around and claim that using that mode showed that the owner of a repo was aware that what they were doing was wrong.
Your idea would have a better chance of success as a separate platform dedicated to anonymous code hosting. But that in turn would likely attract bad actors, as usual.