The Type XXI U-Boat had a rubber coating, making it difficult to detect. Also, its streamlined design allowed it to move faster underwater than it could while surfaced. It had a sophisticated electronics system.
Also, if you’re giving Germany the Type XXI U-boat in 1943, then you should also give it the kinds of torpedoes it had available in 1945.
The standard-issue torpedo of WWII used a diesel engine. Air was stored aboard a pressurized container in the torpedo; allowing the diesel engine to operate. Torpedoes like this were noisy, making them easy to detect and evade. They also left a telltale trail of air bubbles–a trail which could lead people back to the ship that had launched them. At night in the South Pacific, this trail would glow, due to the presence of glowing algae.
The Japanese had developed a process by which to separate oxygen from the non-oxygen components of air (such as nitrogen). Their torpedoes contained tanks of oxygen-only; thereby multiplying their torpedoes’ range while greatly reducing the visibility of the air bubble trail. Their Long Lance torpedoes were much better than Allied torpedoes.
Germany tackled the problems associated with conventional WWII torpedoes in a different way: by going electric. An electric torpedo produces almost no noise; making detection very difficult. Also, there is no air bubble trail to lead people back to the sub which launched it. However, early versions of electric torpedoes had very short ranges: considerably shorter than standard-issue diesel torpedoes. Germany steadily increased the range of its electric torpedoes as the war progressed. By the time the war ended, the range on German electric torpedoes was still not comparable to Japan’s Long Lance torpedoes. But they had caught up with–or perhaps slightly exceeded–the range associated with standard-issue diesel torpedoes.
While the Type XXI U-boats didn’t see action before the war ended, a smaller version of this submarine did. IIRC, none of these smaller submarines were destroyed by enemy action. They sank several enemy ships. The stealthiness of this design and of its mode of attack allowed it to seek out and destroy enemy targets, without itself being subjected to return fire.
Had the Type XXI been deployed in large numbers in 1943, the result almost certainly would have been a massive increase in British and American shipping losses. A staggering increase. While that wouldn’t have changed the long-term strategic equation for Germany; the destruction of so much Allied weaponry on the oceans might have slowed the Red Army’s inexorable advance westward; while also potentially delaying the D-Day invasion by one year.