While this is true, I have a few major gripes with the toolchain that comes with XCode. For instance, I was recently working on a project using C++17 features. It works correctly on linux and windows, but making it compile on macOS was nigh impossible. The clang compiler that comes bundled with macOS has a "special" version that makes it very hard to know where exactly it stands compared to the normal LLVM repository.
Then there's the problem of libraries. You have to use homebrew or whatever to install libraries in /usr/local. Some libraries would conflict with the system though, so you have to fiddle with env variables to make the build system find it.
Overall, building on MacOS/Xcode is a frustrating experience. I ended up installing nixos and using its toolchain for my work...