Here's the mod I did:
https://forum.cockos.com/showpost.ph...68&postcount=9
Behavior is unchanged, but now you have a method ProcessBypass that you can override for your own behavior.
For example, in my delay plugin, I'm mainly interested in not trapping and recirculating glitches in the delay lines when bypassing and unbypassing. In addition to the usual override of ProcessDoubleReplacing, I override ProcessBypass. I have a gain object that ramps gain up or down depending on whether it is muting or unmuting (driven by a state machine). That element is used as part of my audio processing chain, to apply gain heading into my delay lines. When bypassed, ProcessBypass is called, and I "mute", initiating the down ramping of the gain element. (It doesn't matter that I repeatedly command it to mute every time I process a buffer, because the state machine keeps it on track.) I call my normal audio processing method, then discard the result and copy the input to the buffer—because I only care about maintaining the delay lines internally.
When unbypassed, I "unmute", and process as usual.
If you're getting pronounced clicks, you could have DC offset, or it could just be large differences due to processing and levels.