Well, in WW2 either SM U.21 (Hersing) or austrian U.14 (Trapp)
Hersing was just the classical submarine hero, basically "saving" the dardanelles by sinking HMS Triumph and Majestic and even diving beneath sinking Triumph to escape destroyers.
Also, U.21 was the first ship to sink another ship by torpedo, when it sank HMS Pathfinder.
Unusually, Hersing, U.21 and most of the crew stayed together until August 1918. U.21 sank two Battleships, two cruisers and 36 merchantmen.
I hate "sound of music", but Trapp still was IMHO one of the best submarine skippers ever. U.14 was an interesting boat (french boat captured while trying to sneak into Pola) and Trapp surely made good use of it. U.14 (ex Curie) was the highest scoring french sub in WW1, and maybe the highest scoring french sub ever. Unfortunately after it was captured by the enemies of France :P
In WW2, of course U 48. It was apparently such a good crew that no matter what incompetent skipper (Rösing? Bleichrodt?) you put in command, he still produced results.
And of course U 123, on of the most successful IXs and the luckiest for sure, as it survived the war.
Regarding US boats, look at my signature...
Seriously, my US favorite is USS Silversides, as Creed Burlingame simply was a cool guy
Apart from that, I like the second obscurest sub in WW2, the HRMS Delfinul, the only sub of the royal rumanian navy. Ten war patrols in the black sea, a single torpedo attack (which missed).
The most obscure are the Thai subs, I havent been able to find out anything about them.
Postwar, my favorite is Wilhelm Bauer, the R&D sub of the german navy, the only preserved type XXI.
And of course any of the new HDW fuel cell submarines.