That is the whole point with cops going crazy because they see a gun.
Well they’re big problem right now is going crazy when there isn’t even a gun to see. But generally speaking lines of communication and keeping everybody informed and calm is the way to go. Long before the current wave of kerfuffle began I was taught if pulled over with a gun in the passenger compartment tell the cop and follow instructions. When I have practiced that everything went smoothly and the cop thanked me. When I didn’t things got hairy, because he didn’t know. Remember traffic stops are right after domestic disputes as far as danger to the cop is concerned, so on some level they’re walking up to your car wondering if today is the day they get killed. So telling them there’s a gun and asking how they wish to proceed is your way of saying “not this stop”, as opposed to them suddenly seeing a gun which makes them freak out. I’ve had multiple encounters with cops where I was armed (including when I was looking for the SOB that stole my bike) and I can the first difference between the ones that went well and the one that got a little scary was talking.