`mark` would maintain all data in the buffer after the mark, and this PR could be rewritten using `mark`.

Unfortunately, #3656 is stuck right now because of my lack of understanding as to why it's affecting the build, so `mark` isn't yet available.