I'd definitely much prefer if even for "ecosystem" the companies would not require online account except where truly necessary (purchases?), but for operating the OS itself, I do feel there's a line in the sand where online account requirement = no.
Try to run any developer tool or "xcode-select install" and it'll download the command-line tools independently from Xcode.
(and then bring your own IDE)
You can install XCode CLI dev tools without an Apple account, which comes with clang and swift for example. With this, you can build most Mac software, but I don’t think you can run Swift tests without a full XCode.
As the sibling comment notes, you can install GCC/llvm and whatever other open source tools and build Mac software without full XCode.
You can also install Apple container support without an Apple account.