To those arguing that GitHub needs to do this because search is resource intensive, why can't GitHub put their code search behind something like Cloudflare Turnstile?
See e.g. Troy Hunt doing this for HaveIBeenPwned: https://www.troyhunt.com/fighting-api-bots-with-cloudflares-...
I have had my own issues with Cloudflare Turnstile (https://news.ycombinator.com/item?id=38412057), but in principle, I don't see why can't this be done