The Swordsman Without A Name (actually, he takes the name Sanjuro in the titular sequel), unlike the warriors in Seven Samurai or indeed most of Kurosawa's other protagonists, isn't what you would really call a good guy: he's only in it for the money, lending his sword out to whomever can pay him the most, then (usually) dropping out of the fight when it gets dangerous. This isn't because he's a coward, but because he's simply practical: he sees no reason to die for honor or to uphold some nebulous warrior ethic (the bushido code).
Seibei, the leader of the prostitution gang, hires him on the spot, but when Sanjuro overhears Seibei's wife planning to slit his throat as soon as the next big fight with the rival gang is finished (to get out of paying him, you see), he decides prudence is a better course, and quits. The two gangs meet in the street, feinting at each other like children, as Sanjuro watches from a high observation point, amused at the spectacle. A messenger arrives, however, spoiling the fight: a local government official is about to arrive, so the two gangs make nice and persuade the townspeople to come out from behind their normally shuttered storefronts.
One of the greatest samurai films ever made - hell, one of the greatest films ever made - Yojimbo is essential viewing. You can't call yourself literate concerning Japanese film without having viewed this one.
(Note: That's Tatsuya Nakadai - of Kagemusha and Goyokin fame, among others - wielding the pistol in the photo.)