I'm not sure it's "prevailing wisdom" though. It's mostly just people online getting all furious in advance about an imaginary law change that might never happen.
Certainly there's a chance nobody gets any state pension in the future, or it's means-tested or something, but I wouldn't say it's definite. Also, assuming you're a normal employee on weekly / monthly payroll, there's not really a way of opting out of National Insurance contributions.
"Hi, is that HMRC? Yes, I'd like to stop paying NI because someone on P&B told me I wouldn't be getting a state pension".