Xcode command line tools install error trying to run homebrew
This question has my best answer for installing the tools.

Can&#39;t install Homebrew on macOS Mojave; installer doesn&#39;t recognize Command Line Tools

I prefer running it without Xcode or a developer account, but if your are super paranoid on security, perhaps downloading it from Apple developer wen site lets you validate the checksum and sizing before you install it? If you trust Apple updates for security, you should probably trust them for the Xcode tools, though.