"I do not consent to searches" and if you insist on that statement and continue to refuse because they are going to try to convince you that your better off being searched so that you can be on your way.
Unfortunately everyone needs to brush up on the law a little bit better. If you tell a law enforcement officer that you possess a firearm, EVEN IF DOING SO LEGALLY, he would be justified in conducting a frisk of the area that you indicate contains the firearm per Terry v. Ohio. You can argue against it all day long, but no court will uphold that the cop violated your rights by locating a weapon that you told him was there. To be technical, he would also be justified in doing a frisk on the rest of the car as well. If you are a law-abiding citizen and have your CCW, that's probably not going to happen... but the frisk would be upheld if he did.
With that being said, the vast majority of cops in gun friendly states have a little bit of common sense. Unless you come across as a shady guy (and most cops are really good at perception, so if you're legit most seasoned guys will pick up on this quick), they aren't going to get antsy when you tell them you have a gun. They'll ask where it is, and most will want to hold onto it for the duration of the traffic stop. I do the same thing, It's nothing personal. I DO NOT WANT YOU FUMBLING AROUND IN THE BAG. Sorry, it's not personal but I don't know you... so I don't fully trust you. Hand the bag to the guy, ask that he goes inside and finds the gun in your presence. Then ask for the bag back. Once he determines that there are no other weapons then he can not conduct a further search without your consent. Most guys won't care if you don't give off bad vibes. Pretty much every guy I know will hold onto your pistol for the remainder of the traffic stop, then they'll give it back with a smile.
REMEMBER THIS. You don't know why the guy pulled you over. It could be for running 7 over the speed limit. It could be because you and your vehicle fit the description of an armed robber or axe murderer. Just cooperate and let him retrieve the gun. I don't blame you for not wanting to have the bag taken back to his car. That is your right to keep it once there are no more weapons in it, but don't die on the hill of "you can't search my bag." Yes, he can if you just told him there's a weapon in it.