This is exactly my gripe unfortunately, it feels like needless fragility. IIRC the author has said they believe it wouldn't be too difficult to patch QBE to work as a library, but from what I've seen the code is somewhat terse and eccentric.
IMO when the intended usage is AOT with an external assembler, which is another subprocess, text-based IO is actually the more natural approach.