Yes, my suggested phrasing above should get you a fair salary without reference to previous good pay stubs, assuming you make inquiries as stated. If you weren't overpaid before, you should get at least a similar outcome, but you would get a better one if previously underpaid as many people in protected classes unfortunately still are.
If you were overpaid, and want to try to keep being overpaid, see below for a scenario that you can mentally adjust from fixing underpayment to preserving overpayment (in which case verification is even more important if the employer decides to bite that bullet).
Underpayment of disadvantaged colleagues is so much more common and so much more long-term impactful than overpayment of anyone involved in this style of negotiation; I care more that the law addresses the former than that it prevents the latter. People have useful indirect ways to signal high pay anyway even if they were forbidden from saying it explicitly, far more than underpaid people.
The prior pay information is illegal for employers to solicit in these jurisdictions, even if they are willing to make it voluntary by accepting no for an answer. The only way the info will make it to a law-abiding California employer is if the candidate decides it's to their advantage to volunteer it, as they probably would if the initial offer is a low-ball. If the candidate doesn't volunteer it unsolicited, the info can't legally come up (and if it somehow does [e.g. turns up in a third party background check] the employer can't use the info during the hiring process).
As for why that needs to be allowed, consider this scenario:
Company: What salary are you looking for?
Candidate: Market rate.
Company: How about $X? We like you and it's the highest we usually offer for this position to a new hire.
Candidate: Hm. While I agree $X is within the market rate range, I currently make $X+10k which is also within that range. Can you at least match that?
Company, after consideration: Hm. Yeah given that we don't want to force you to take a pay cut, we'll make that exception.
Or, even more compelling last two lines:
Candidate: Hm, my current company is already paying me $X, and has been doing so for 3 years now despite my skills growing significantly in that time. Can you recognize that growth with a modest pay raise?
Company, after consideration: Hm, we realize you won't trust our willingness to support you if we keep your compensation stagnant for a fourth year and counting. We can't break our salary band, but we'll at least give you $10k/year extra in restricted stock units [assume a public company].
In such scenarios, verification makes sense to require and allow.
Also note that these jurisdictions generally have explicit bans on paying differentially based on protected attributes like old age or gender, and that these laws about salary history (which are just a tightening of their former greater permissiveness that still prevails elsewhere) don't override those rules.