Is there anything I can do to help move this along?
append_output only interacts with one other function, and this doesn't change the interface to it, so from a correctness perspective, I think this should be easy to verify.
From a design perspective, I don't know if this is right, but I
couldn't think of a better approach. Exposing the buffer size to callers seems not ideal to me. Is there an alternative I'm missing?