MD law allows transport of a handgun to a range, to a gun shop, etc., if inaccessible to persons in the vehicle, which means the trunk. In spite of the limitations, I doubt there would be any problems for a person travelling through the state if the gun were in a locked container in the trunk. Just drive reasonably and remove "gun stuff" from the inside of the car. A speed loader or pistol magazine spotted by a police officer is considered probable cause for a search for a gun.
In any case, the idea is not what to do if stopped, but to avoid getting stopped in the first place. Which means not calling attention to oneself or one's car. Avoid "Off the Pigs" stickers, "Cold dead hands" stickers, and the like. Drive with traffic, don't weave, don't give the famous salute to cops, don't wave guns around, etc.
Jim