Tweaking serialize_buffer to allow for copy and reference semantics on the sending end