Looking into the Bastille code, which has (and uses) their own to_buffer, I also see a defined function buffer copyBuffer(buffer), which seems like it's the equivalent, except it takes a buffer instead of a string.
It's not used in Bastille, but is in all the same Ezandora-derived scripts and...