What are the implications of deleting all content of /usr/local?
The main issue here is that you use Homebrew.
Homebrew puts its files in /usr/local/ so deleting /usr/local will remove Homebrew
So if you are prepared to reinstall Homebrew then no real issue.
However if you are not installing R and rstan via Homebrew then you will get the same issue again. If you can install them via Homebrew than that is a solution.
Basically if you use Homebrew then do not install other software in /usr/local (e.g. via normal Unix make install) as they confuse each other.
If you have to use software that has to use its own installer to end up in /usr/local then I would suggest another package manager e/g/ Macports or Fink or build your software setting the install directory to be something other than /usr/local