Since when do I have to login to search GitHub code?
The URL triggers an “advanced search” (“Code” only, instead of “All GitHub”). For that, they want your login.
No long required and regex search (not that it is needed here). Plus it searches GitLab too. (I think there is a repo limit though based on popular repos)