Megatron may be the best known robot who transforms into a gun, but he's not the only one:

I don't know anything about this guy.
EDIT: I was lazy when I wrote this, but just took a minute to Google for this guy and apparently his name is
Cap Pistol (original, I know.)
He's clearly branded as a Gobot and I know he's legit, but he's nothing like any of the better known Gobots of yesteryear. All plastic and super low-rent, the only marks I can find on him is 'Made in Hong Kong' inside one of his legs. *edit I take that back, it says 'Arco' in his left armpit.

He looks like he's wearing a dapper red cap over his hair and sideburns. Get it? a red cap - Cap Pistol! Hahaha them dudes at GoBots were cleverer(er er er) than I thought! /sarcasm
His face is just a decal, so I imagine that part of him takes a beating over the decades. I am surprised I found him in such good shape at the (you guessed it) swap meet.

Unlike Megatron who transforms into a realistic Walther P-38, Cap Pistol transforms into a spiffy space gun ala Flash Gordon. PEW PEW PEW! Take that Ming!

And he's a real working cap gun too. Fun!
This guy is super kooky and I'm glad I have him now, although I probably would have thought he was the lamest toy ever back in my Gobot collecting youth.