The "Command Line Tools for Xcode" don't require an Apple ID to install (and provides a C/C++/Objective-C/Swift toolchain (LLVM/Clang) and things like Make and Git). Not to mention other compilers not provided by Apple that you can just download and install. And yes, while you do need an Apple ID to download Xcode from Apple, you don't need to be signed into macOS with it (you can download it from the Apple Developer site).