Soundflower is open source: https://github.com/mattingalls/Soundflower could you just use that? The issue is getting a certificate to sign kernel extensions. It takes months. I’m not sure how you’d grab an individual applications output.
Windows it’s pretty easy to capture all system output: https://docs.microsoft.com/en-us/windows/win32/coreaudio/loopback-recording
Not sure how to do individual applications, but this SDK might help: https://www.d3dgear.com/game-capture-sdk