If you are in a situation where you are even seriously considering a nuclear strike, that means you are viewing a threat as existential, which completely undermines the economic argument.
> This needs what you said before, second-strike capability. Either that or a fast enough response time that they can launch while hostile missiles are still inbound. (Or does that still count as second-strike?)
Absolutely, but the issue is that this takes A LOT of time to build and implement, and a country like Poland or Germany cannot build that kind of capability overnight. Yet a nuclear program can be viewed as an existential threat that can be used as a causus belli for war (conventional or nuclear).
This is a pretty bad RoI.
Nuclear programs are expensive, and instead of spending the amount you would need to build a nuclear program, it's much better for Poland and Germany to double down and concentrate on conventional war capabilities such as rocket systems, drones, artillery, and heavy weapons. The fact that a country with an ossified MIC like Ukraine is able to bog down a military like Russia's with conventional capabilities is proof enough that doubling down on building conventional war-fighting capabilities is enough to cause severe pain on an aggressor while not turning a conflict into an existential one which justifies nuclear warfare.
And this is why you never hear Polish or German military leadership talk about developing a nuclear program.