changed the output API to allow avoiding copies and not being limited by the internal output buffer

A caller would anyway keep the whole data in memory while it is being flushed through the mux.
In such cases it's just easier and faster to pass the data to the mux so it will take care of flushing,
drastically reducing copies. Note that the mux might still impose an upper limit to queued data
to avoid allowing to queueing more data than it's possible to send out