I’ve used a compressor in my guitar rig for a few years now and wouldn’t be without one.
Bass is a different matter though. I’ve avoided using any effects at all on bass for the last 10 years or so, but that is changing. I have recently joined a Bowie tribute in which we play Ashes to Ashes. Parts of this are slapped and popped - pretty much the only time that I play in this style. I can turn down slightly in those sections but it’s tricky to get right.
Last gig I took out my guitar mini board which includes a tuner and a Biyang Dyna Comp clone. The latter actually worked quite well to limit the transients, but next gig I intend to take the big box Cali76 from my home studio and have it permanently engaged on top of my amp. I have it set so that most of the time it is doing very little, but clamping down quite hard (16dB or more of gain reduction) on loud peaks.