This is kinda dangerous.
How would a NEP oriented USSR fare against Nazi Germany?
Much better, cause you'd be rid of Stalin. Perhaps worse, cause arguably the factories Stalin shoved through their throats might have saved their asses. Another reason for worse is Stalin might have stopped some potential nationalistic uprising.
So who knows 😉
Anyone other than Stalin would not have cut a deal with the Mustache in 1939 to be near allies, in the face of total hostility from 1932-1938
Maybe even better if whoever took over instead of Stalin had listened to his own generals instead of executing them and bothered to prepare for a surprise attack.
The idea that Stalin and his obsessive focus on heavy industry and military buildup at the expense of everything else saved the USSR is something that you hear sometimes, especially in the former USSR. It's false, and it's also really problematic IMO because it can be taken as justifying the idea that you need a Strong Authoritarian Leader and not Weak Decadent Softies to defend your country against a Foreign Threat and Pull It Into the Glorious Future. That's a very, VERY common talking point among dictators of all stripes that has been used to justify slews of awful things.
For the record, Russian industry actually grew fastest
during the Czars when the economy was at its most liberal—production of most of the main industrial products went up by anywhere from 2-5x depending on the good from 1887-1900, with slower but still very significant increases after that. In about thirty years from 1881-1913, they were able to go from an agrarian backwater to having about the industrial production of France. The Soviet Union never even came close to accomplishing anything of comparable magnitude when you adjust for things like the quality of their products, statistical fraud, the ability of workers to actually use/crew what was produced, etc. Communism was never necessary to industrialize Russia, and it did nothing but impede that process.
More specifically, with regards to the Soviet Union, multiple studies have been done that show Stalin's economy significantly underperformed where the USSR would have likely ended up if the trends from the NEP era had continued.
They are not kind to Stalin. The most conservative ones indicate that the NEP continuing would have most likely delivered the same gains as Stalin's program without all the deaths and the collapse of agriculture. His purges of skilled workers, famines, collectivization, and mismanagement did nothing but hurt the process of industrialization. Total Factor Productivity in his economy was well below where it was under the czar. Key conclusion of the one that I linked:
Therefore our answer to the ‘Was Stalin Necessary?’ question is a definite ‘no’. Even though we do not consider the human tragedy of famine, repression and terror, and focus on economic outcomes alone, and even when we make assumptions that are biased in Stalin’s favour, his economic policies underperform the counterfactual. We believe Stalin’s industrialisation should not be used as a success story in development economics, and should instead be studied as an example where brutal reallocation resulted in lower productivity and lower social welfare.
The other thing key to understanding Stalin's legacy in WWII was just the sheer idiocy of the geopolitical decisions he made leading up to it. The military purges, the dismantlement of the Stalin Line before the Molotov Line was constructed, and refusing to acknowledge any of the obvious warnings that Hitler was about to attack are low-hanging fruit, but there were so many,
many others. The trade agreement with Germany, and critically the decision to continue deliveries of raw materials for a year AFTER the Fall of France, was a biggie. The Reich's war machine would have broken down long before June 1941 without that.
Attacking Finland, then failing to finish the job was literally the worst thing he could possibly have done—it ensured that the Finns were royally pissed off/willing to ally with Germany while also leaving them with the ability to put half a million men into the field against the USSR. Not going to war with them would have ensured Murmansk and the Kola Peninsula was safe unless Hitler wanted to fight the Finns, too (since the Reich would have had to cross their territory to get to that part of the Soviet Union). A neutral/friendly Finland would also have prevented any siege of Leningrad and freed up millions of troops to fight the German Army which actually came quite close to collapsing (they had 8 divisions classified as fully operational left nine months after Barbarossa started).
Putting in the full might of the Red Army and conquering them after starting the Winter War would have had all of those benefits besides the shield of neutrality for the northern USSR, and it would have allowed the Soviet Navy's subs to torment German iron supplies in the Baltic, allowed them potentially to counterattack Germany's iron supplies in northern Sweden, etc.
As is, Stalin managed to choose literally the worst option of all.
Dismembering Romania ensured that a rabidly anti-Communist regime took over that was willing to not just go to war with the Soviets, but to put their everything into it. There are others you can name, but those are the main ones.
The USSR was worse off in every way imaginable for having had Stalin. Zero question about it.