Without this change communicating 700MB worth of data to 'cat' takes
~1h, with it it's closer to 1s.
My hypothesis is that `input[0...written] = ''` causes ruby to either
allocate a whole new string buffer, or at the very least rewrite the
entirety of the existing buffer, whereas `input = input[written..]` lets
ruby use shared string optimization and only create a new RString
pointing to the same buffer.
Authored-by @synfo-stripe