Having different versions of getGains that differ only in const-ness, one of which is realtime-safe and one of which is not seems like a good way to introduce bugs.

Is the non-const version useful for anything?

I suggest we either eliminate the non-const version or rename them to indicate realtime safety or lack thereof; perhaps getGainsRT and getGainsNonRT.