I'm mystified at Homebrew's dominance. It seemed to come unglued for me every few months. I switched to Macports years ago and my cli world has been stable and up-to-date.
I suspect because users and the originbal auithor did not understand multi user UNIX and so don't like the idea of having to use sudo and also they use Apple tools as much as possible rather than controlling the versions of libraries that they use which would be what commercial users were doing with Unix over 20 years before. It also uses /usr/local which is for locally compiled software so you get in a mess if you have a compiled version of a library that is also in Homebrew.
Macports and nix and fink will build under a new user id and install as root as per any other Unix. Thus the build can be controlled to only use known versions of other libraries.
Homebrew installs as the current user. - Try using it when you do have multiple users on a mac (which is uncommon).
That is only true on Intel—on Apple Silicon it uses /opt/homebrew—so it will only become less true as time goes on.
The only reason it used /usr/local in the first place was that at the time many of the software packages it supported were broken if installed anywhere but /usr/local. In other words, Homebrew didn’t pick that ___location to annoy you or because they didn’t know better, but for a real practical reason.
That ___location was always an optional default, you’re free to change it. If you do, everything will be compiled from source rather than using compiled binaries and won’t be offered support. But it does work.