In season 2 episode “A Piece of the Action”, Kirk, Spock, and Dr McCoy find themselves on what can only be described as a gangster planet. Populated by folks clad in pinstripe suits, clutching tommy guns and talking like James Cagney, the Enterprise crew are baffled at first at this strange new world.
That is until they stumble upon a book about the Chicago mob, on which this planet has apparently built its entire civilisation, which explains that. It’s not long before Kirk and the gang find themselves in the middle of ongoing mob warfare, with rival crews demanding use of Starfleet’s advanced technology. Captured, Kirk thinks quickly, and with the cunning strategy of putting on a fedora manages to infiltrate mob HQ. In due course he has inserted himself as top mafioso, with the technologically impaired gangsters left with no choice but to cough up 40% of their annual takings to the Federation (or be killed, presumably).
Kirk claims that the takings will be put to altruistic use, but any gangster worth his salt can convince himself he’s doing the right thing. One hour in a pinstripe suit and Kirk transforms into Scarface.