Rurouni Kenshin uses this trope during the Kyoto arc, when Kenshin tries to rescue a baby named Iori from Chou, the Sword Hunter. Chou kidnapped the baby for forcing his parent to tell him the location of the last sword ever made by the legendary sword-smith Shakku Arai, Iori's grandfather. Kenshin manages to pull a fight even though his reversed-bladed sword is broken, but Chou eventually disarms him. When everything seems lost, Iori's father appears and gives Kenshin Shakku Arai's last sword. However, Kenshin hesitates, since using a normal sword means that he will almost certainly kill Chou, which would break his oathof never killing a man ever again. Only when Chou threatens to kill Iori on the spot, Kenshin snaps out of it and defeats Chou with a single blow. Then everyone realizes that the sword was also reverse-bladed, so Chou naturally has survived.
Trigun: Vash uses guns all the time. However, as a master of Improbable Aiming Skills, he uses it solely for trick shots, and when in serious trouble, will at most shoot a person somewhere where they'll heal. He doesn't believe in a situation where you can't save everyone. However, at one point, he is given a true no-win scenario, where the villain sets up a situation that will result in the death of his friends, unless the villain is killed (he has... issues). After much hesitation, Vash kills him. He doesn't take it well. Bear in mind that this was merely The Dragon he killed, and getting himself shot was the whole point.
Oddly enough Vash was almost willing to kill someone much earlier in the series for killing a few dozen people. But that side of him was pretty much never seen again after.
Miria in Claymore breaks her one rule of never killing fellow Claymores during her battle against Hysteria the Elegant, as that was the only way to end the fight before a recently Awakened Cassandra killed all her allies.
Monster: One of the major theme of the manga is the mental and physical tribulation of Dr. Tenma as he's forced to pick up a gun to hunt and kill a monster he unknowingly saved. This trope already has a bleak atmosphere hanging around it, but it's pushed to the realm of Deconstruction in his case. In the end, he didn't kill anyone. Not even The Dragon of said monster he thought he killed. Not the monster himself, the final confrontation with whom put the life of a child at stake.
Fullmetal Alchemist: In his battle with Wrath near the end of the series, Scar breaks his code as an Ishvalan and uses Alchemy to reconstruct matter, thus regaining the upper hand. Up until that point, he only used his abilities to destroy things and so remained technically within the bounds of his code against it.
In Zatch Bell! The heroes are fighting Zeon's co-dragons in an attempt to stop Faudo, a giant demon who towers over small mountain ranges. Things are not going well they are getting defeated one by one when Umagon desperately starts raising the heat in the area with his flame spells. The villains are confused at first, since there isn't enough heat to burn the Demon's book, which would take him out of the fight, then we get the truth: Umagon isn't trying to burn the demon's book, he is trying to boil the demon's human partner alive.
Nanashi in Sword of the Stranger has his sword bound with a rope, and he has vowed not to draw it. You know where this is going - as he draws his sword at the climax, shit gets real.
There are numerous counter-examples (his 1939-1940 version (now out of continuity) used a gun occasionally, and there are isolated stories here and there where he uses one as a threat or a tool), but as far as the spirit of the trope goes, Final Crisis is the only current in-continuity example of Batman using a gun with intent to harm/kill and going through with it, and even the current page image from Batman: Year 2 had him not go through with it in the end thanks to circumstances outside of his control.
This is all of course separate from "out of the field" use of a gun such as for ballistics analysis.
Pretty common in general among the Gotham heroes, as it happened with Catwoman against Black Mask.
Two-Face had a villainous one a long time ago, choosing to ignore his coin to spare Batman's life.
Superman finds himself forced to execute Kryptonians of a "pocket universe" after they have killed almost everybody in their universe. This experience eventually causes him a breakdown. Superman at Earth's End has Superman use a (very) heavy machine gun to kill twin clones of Hitler and zombie Batman.
An aversion in the final issue of Richard Dragon's series. He's sworn off killing, and SPECIFICALLY sworn off using the deadly Leopard Blow, but resolves to kill one final time (specifically, to kill his love interest/arch enemy Lady Shiva) to save the life of a young boy. During the climactic battle with Shiva, he has her set up for the blow, and attempts to deliver it, but is tackled away by her ninjas and killed shortly thereafter. It is worth mentioning that large parts of this series have been booted from canon.
Subverted during an arc of X-Men: Professor X, of all people, is packing heat. But it's only to use as a last resort on himself to prevent any evil force from "hijacking" his brain (arguably one of the greatest weapons in the Marvel Universe). When faced with such a threat... he does not go through with it, giving the entity a chance to leave his mind before he fires. Things go downhill from there...
Spider-Man in the Back in Black arc nearly fits this trope. After Aunt May is shot by a hit man, Peter flips out and dons his black costume. He goes around the town beating anyone remotely involved with the shooting until he finally meets the main villain, Kingpin. If Kingpin had a fair chance against Spidey during the 1970s and 1980s, we don't see it here: In the end Kingpin is left bleeding and broken with a promise, if/when May dies, Kingpin will follow. There is a What If… story where MJ takes the bullet and dies, and Peter goes on full rampage and in the end punches Kingpin through the heart. Try to remember, this is from the "friendly neighborhood" Spider-Man.
In Superior Spider-Man, Spidey/Dr. Octopus confronts the murderer Massacre after he escapes and begins to kill again. In his anger, the web-slinger snatches a fallen gun and shoots him in the leg, then puts the gun to his head. At that moment, Massacre, who had no emotions thanks to a horrible accident that damaged his brain, started feeling fear. Despite the pleas from Ghost!Peter, Ock has no remorse for such a callous killer and shoots him dead.
ROM: Spaceknight usually follows Thou Shalt Not Kill, but made an exception for Hybrid when he realized his Neutralizer couldn't banish a human-Wraith hybrid to Limbo and that Hybrid was too evil and dangerous to be allowed to live.
In Starman, Jack Knight kills exactly twice: the first was Kyle, the son of the Mist, while the second was Medphyll, a Green Lantern-turned-traitor. Both weighed heavily on his mind, especially the first one, and he eventually meets them in the afterlife and makes peace with them thanks to his brother David.
Adrian Veidt/Ozymandias in Watchmen spent his crimefighting career as a friendly, idealistic and well-liked superhero who refused to kill and cooperated with the authorities. Then he became convinced that only he could save the world, and embarked on a horrific campaign that culminated in the mass murder of three million New Yorkers.
In The Rundown, the Rock's character refuses to pick up a gun the entire movie, maintaining that "bad things happen" when he does. When he gets into a tight spot in the end, he does end up using guns — and it's awesome.
In Unforgiven, William Munny avoids drinking because his wife "cured" him of such vices before she died. When Little Bill kills Ned, Munny finishes the Kid's bottle of whiskey and goes on a Roaring Rampage of Revenge.
In The Dark Knight, The Joker tells Batman that "tonight [he's] going to break [his] one rule". Batman's reply is "I'm considering it." He doesn't. Then, at the end, Batman tackles Harvey Dent, who falls of a ledge and dies. Depending on your interpretation, The Joker was either completely wrong (if it was an accident) or just one day off (if it wasn't), or Batman simply miscalculated the strength that was sufficient to subdue Dent in the heat of the moment (again, if it was an accident).
During the final confrontation in The Dark Knight Rises, Batman seems completely willing to kill Bane, and isn't simply considering it, as he repeats his opponent's earlier threat to make him suffer a horrible death in a ironic way. Bane himself prefers hand-to-hand neck-snaps over gun executions, but after being beaten to an inch of his life and planning on dying either way, uses a gun to make sure Batman STAYS dead. And ironically, is shot in the face by Catwoman riding the batcycle. Finally, Batman himself personally shoots TWO PEOPLE with explosive rounds, but by then he's only got minutes to prevent an atomic bomb from killing twelve million people.
The series itself inverts this in his character backstory. His first method of dealing with injustice in this series was going to be to shoot his parents' murderer, Joe Chill (fortunately for Bruce, the mob got to Chill first). It's his shame over this incident in reflection that causes him to adopt his normal rule about not using them.
In The Omega Man it is actually one of the villains who suddenly picks up a gun he has secretly been carrying in order to use it against the protagonist. This is despite being a member of a cult of mutated technophobes who refuses to use complex devises on ideological grounds and who wants both technology and the protagonist destroyed.
In Star Wars, Obi-Wan Kenobi hates using blasters, finding them uncivilized and crude. But in Revenge of the Sith, when it's the only weapon available, he grabs one to kill General Grievous. Afterward, he throws it away and remarks "so uncivilized.", as a humorous Call Forward to A New Hope.
In The Dresden Files, Harry has been offered incredible power, often at terrible prices, throughout the series. He's always refused, though at the same time has always been tempted by that power. Offers range from the addictive draw of pure Black Magic, the eternal knowledge and power of a Fallen Angel, the possible godlike power of the Darkhallow, and the standing offer by Mab, Queen of the Winter Court, to become her Knight. Harry steadfastly resists all of these offers, as he knows that succumbing to these temptations will destroy him as a person. Then the bad guys kidnap his daughter, and Harry accepts Mab's offer to become her Knight.
Earlier on, he threatens to pull everything listed above to his advantage if Mavra the Black Court Vampiress ever does harm to his friends again (especially Murphy). The threat is so effective that Mavra hasn't been seen or heard from since.
In many Discworld novels, Sam Vimes thinks about how he's afraid of what he might become if he started acting outside the law, and hopes he never finds something awful enough to make him cross the line. In Snuff, he finally finds it.
Famously done in Magnum, P.I. with Magnum shooting an unarmed man.
Leverage: Elliot Spencer does not like guns. He never said he couldn't use them.
White Collar's Neal snaps in this manner in the second season episode Point Blank, when he has a chance to encounter and kill the man who he believes killed Kate. All of his friends are so worried about him being in this state that when Mozzie finds out he's got a gun, he immediately calls Peter, an FBI agent, which is his equivalent of this trope.
Interestingly, that episode actually makes a couple of Batman references early on, so it's entirely possible that Jeff Eastin is One of Us and decided to give us tropers a Shout-Out.
Person of Interest: When Carter's son is kidnapped, the very anti-gun/anti-weapon Finch is so desperate to help save him that he picks up a gun and asks Reese to teach him how to use it, though he's quite realistic on what sort of assistance he'd be able to give even with a gun. Reese, however, refuses to teach Finch and instead suggests that Finch perform the very valuable assistance of being ready with the get-away car.
The title character of Chuck hates firearms, preferring tranquilizer guns. The only time he uses one is when his girlfriend and partner Sarah is being threatened.
John Drake in Danger Man rarely uses a gun, to the point where when he does it's actually a shock. In the entire run of the series, Drake shoots only one person (not counting a later episode with gunplay that ends up being All Just a Dream).
The main character in The Prisoner never uses a gun, until the events of the final episode push him too far. (Some believe the character is the aforementioned John Drake.)
In the Star Trek: The Next Generation episode "The Most Toys", Data witnesses Fajo murder one of his employees with a weapon that was banned because of the slow, excruciating manner in which it kills. Her death is so brutal, in fact, that it even Fajo is clearly disturbed by it—so much so that he throws the weapon aside in disgust. Data, an android who's actions are strictly governed by ethics software, picks up the disruptor, aims it at Fajo, and talks himself into pulling the trigger. Fortuitous timing on Chief O'Brien's part saved Fajo, but tellingly, Data lies to Riker in his report of the incidentnote Or at least comes up with the Metaphorically True statement "Perhaps something happened during transport" regarding the weapon discharge. Something did happen all right, namely him pulling the trigger. Riker doesn't buy it, but lets it slide.
In Doctor Who the Doctor is a Technical Pacifist that has replaced someone's gun with a banana on at least one occasion. Even if he does resort to using weapons in dire situations, he'll try to avoid a gun and go for something explosives-related. In "The End of Time" he pointedly refuses Wilf's old war pistol to use against the Master... but the moment he hears that the Time Lords are about to return, he grabs it with zero hesitation. And subverted, oddly enough, with the Doctors most violent and least hopeful incarnation, the War Doctor, who picks up a gun only to use it to write "No More" during the Fall of Arcadia.
Done subtly in Revengeance. Raiden says multiple times that he fights for justice, and he sees his sword as a tool to protect people weaker than himself. However, over the course of the game, he slowly starts going back on this, being forced to nearly kill a kid and unleash his psychotic Jack the Ripper persona to defeat his enemies. This comes to a head in the final battle where he has to use Sam's sword against Armstrong, proclaiming "This isn't MY sword!" and going to town on his opponent. Armstrong seems proud of him, using his dying words to congratulate him for shedding his ideals and being willing to kill.This rocks Raiden to his coreas he realises everything he's had to give up to win. After all is said and done, it's clear in end that he's starting to feel Not So Different from his foes.
In Batman: Vengeance, Batman is forced to use Mr. Freeze's cryo-gun after defeating the madman, whose helmet had started to show cracks. After encasing Freeze in a block of ice, the Dark Knight rather irritably throws the gun to one side.
Batman: Arkham City doesn't have the Dark Knight use a gun, but he does resort to lethal force against two separate opponents. Fully justified in both cases; the first is Solomon Grundy, who cannot be stopped by anything less, and the other is Clayface, who is effectively immune to all of Batman's conventional tactics.
Xenogears: For the first half of the game, Citan only fights with his bare hands. During the escape from Solaris, he pulls out a sword. He says that he had sworn to himself he'd never use it again, but with the state of the world being what it is, he can't afford to be self-righteous and try to keep his "innocence."
South Park: The Stick of Truth has your character, the New Kid (or Douchebag) trained in mystical magical arts (or rather, magical farts) by several different teachers. All of them close their lessons by warning Douchebag to never, ever, fart on a man's balls. However, when Princess Kenny betrays your side and ingests the Nazi Zombie serum, then withstands all of your allies' most powerful attacks in the final battle, Cartman says that their one hope is for Douchebag to break the "Gentleman's Oath", and fart on your enemy's balls. Doing so is the only way to defeat this foe.
Bob and George: This trope becomes a major plot point. George, at the very end, finally uses his arm cannon on Bob. He was shooting to kill, but the cannon didn't fire. It's revealed that the entire comic was meant to bring George to the point where he was willing to use deadly force to stop an enemy—even if said enemy was his own brother.
In the Web Serial NovelWorm, the main character breaks her code against killing when she uses a gun to execute Diabolical Mastermind Coil, reasoning that though he was temporarily outmaneuvered, his resources and powers meant that no prison would be able to hold him even if they could get the heroes to charge him.
Afterworld: The main character, inspired by a vagrant with an interest in nonviolent problem solving (negotiation, scavenging, running), chooses to discard his gun in a hostile post-apocalypse so that he's more charismatic and trustworthy to the people that he meets on the way. However, the west side of the united states develops a high-strung police state, forcing him to grab a gun and start shooting, albeit sparingly and tactically.
"The Savage Time" has an Alternate History version of Batman grab a gun from a fellow resistance fighter. Of course, his parents weren't killed by a lone gunman right in front of him, but killed by Vandal Savage's soldiers storming Wayne Manor.
In the Adventure Time episode "Simon & Marcy" a young Marceline makes Simon promise to stop using the crown that gives him ice powers but makes him more deformed and insane the longer he wears it. He tries his best to keep his promise, but when they find themselves in a dead end ambushed by mutants, he's forced to use it again to protect her.