I think you can do away with this function and save some ram (the serial_buf) in the process.  That method appears to just copy the message to a different buffer and possibly pad it at the end (although I can't tell where/what it pads from).  You could write another function that streams the data directly to pios_com and then if it needs to pad it does that as well from flash.  Basically you copy from message to serial_buf, then from serial_buf to pios_com_buffer

Let me know if this is unclear.