Are you under the impression that you have to use Xcode to create Mac or iOS applications? Or do you just mean that Apple provides an IDE?
You do not have to use Apple toolchain for building macOS apps, if you are content with the fact, that your binaries might be broken in future macOS releases. With point releases, even. For a case study, see golang.
My next phone was one I bought, a Nexus device from google. Want to get an app on it? Download the SDK and tools, fire up hello world, throw it on your phone and it works.
This is exactly how it is done on iOS too from iOS 7/8. You don't need a Developer Account anymore to put your own apps on your own phone. You need a Dev. Account only if you want to push the app on App Store.