I'm no expert, but
Mars' thin atmosphere (which is less than 1% of
earth's) would make even a tiny gun effective. This would also mean that the gun would need to be able to handle the pressure, so maybe it wouldn't really effect the weight.
But what are the weight requirements on this hypothetical mission? Humanity might decide that it won't go to Mars unless it can take ≈ 1 butt-ton (metric) of payload to its surface, or maybe there's some huge leap in launch capability. And if they allocate a tiny fraction of that to "naughty bug-eyed monster"-deterrent, then maybe they can afford a space-gun.
But this would only be useful in a very unlikely scenario. What's more likely:
- hostile multicellular life exists at our landing site and we missed it.
- an astronaut goes "space-crazy" and renders important equipment or crew inoperable with the space-gun.
Astronauts are mentally screened rigorously, but I'd argue that if we have the capacity to take a space-gun with us, then we're probably taking more astronauts.
But is a dedicated combustion-propelled kinetic weapon really the best choice? They might be able to repurpose their other equipment for self-defense. The opposition can't be too big or numerous because we'd of known about them. And if they're intelligent, then the government probably wants to be able to say "Sorry. We didn't know you were here. We're on a peaceful scientific mission."
They might just run. No one's gonna say, "You discovered life on Mars, but you were only on the surface for a few hours? What a waste of tax money!"