I have finally had success. I found a solution here, on the rstan development site no less.
Essentially the solution that worked for me was to install Xcode (I installed the latest version 12.5), but without separately installing the CommandLineTools using
xcode-select --install. Again, I did not install CommandLineTools using
xcode-select --install. Apparently, the Xcode installation includes an installation of the tools in
/Applications/Xcode.app/Contents/Developer. I don’t think I needed to this, but to be safe I made sure the path was set to this directory by executing
sudo xcode-select --switch /Applications/Xcode.app.
After that, within Rstudio I installed
cmdstanr::install_cmdstan(). And I was able to compile my test stan code and estimate a model.
Thank you for all of your efforts to help out. I hope that others find this useful if they run into the same problem.