get-output-stream-string
(get-output-stream-string stream)
Returns everything written to a make-string-output-stream stream so far, and clears it: the next call answers only what was written after this one. That is Common Lisp's contract, and it is what lets one accumulator stream be reused for a sequence of tokens.