Help with multiple receiver channels and single storage architecture
If I understand your design correctly, I think you have a design issue that needs to be addressed first.

You are grabbing data from one of several UART receive buffers and shovelling it directly into a UART transmit buffer.

This will have the impact of mixing up bytes from each of the incoming buffers into the output stream with no apparent way of unmixing them.

Generally when multiplexing streams like this you would receive a delimited packet of some kind, probably terminated with a line feed. You buffer the input until you get the terminator then transmit the buffer, probably with a header marking which stream the line is associated with.

This leads in to answering the problem you are tackling. There are two approaches to this, your current approach is known as hard-realtime. The maximum input rate is X per second, I process them in Y ns, the timing works everything is sweet.

Once you switch to buffers a hard realtime approach gets difficult. A soft realtime approach would use the average rate of incoming data, a buffer (or four in your case) that absorbs some variation in that rate and an average output rate. You design in some margin so the average input is no more than 80% of the output and put in a handler for the very unlikely event that your buffer starts overflowing (dropping packets is normal).

Btw. ring buffers are nice for this kind of constant data in-data out work flow.