As I mentioned in one of my earliest posts on this blog, I have strong feelings on the importance of informed consent.
It's a fact that people lie to one another about their sexual history. Men stereotypically inflate their numbers, while women stereotypically deflate theirs. This is, of course, a response to the shaming responses both genders get as a part of gender policing, and most of the time the worst harm it does is in the form of failing to challenge that gender policing. I'm in no position to condemn anyone for the choice to avoid confrontations and difficult arguments in their day to day lives given everything I hold back, after all.
That said, a part of being in a relationship is establishing mutual trust, and within any relationship founded on a lie, informed consent is not a possibility. Those convenient lies that make our day to day lives easier need to be put aside, little by little or all at once if the resulting relationship can be said to be legitimate.
This is doubly the case when discussing a marriage. The "I do"s of a wedding vow can be rightly thought of as conditional on everything the couple has told one another up to that point being the truth.
Ah, but what of the situation where you know the other party will judge you for your past? When you're in love and absolutely sure that you were meant to be together? When you're sure that the truth will ruin everything and cause you both to miss out on a wonderful relationship and life together?
In that case, I ask: Why do you want to be in a relationship with someone who's only there because you lied?
First off, that certainty that your partner will judge you, that's you being unfair to the partner by not giving him/her the chance to show what the real reaction will be. You are so afraid of the worst case scenario that you've already assigned that reaction to your partner in your head, and you'll be blaming and resenting him/her for that reaction. That's poison to the relationship.
Second, if your partner rejects you because of your sexual history, that's his/her choice and you have to just accept that. Your partner is a human being with his/her own standards and expectations from the relationship, and just as much right to say "no" as you have. Whatever happily ever after you think you can build on a foundation of lies, that inkling that "what he/she knows can't hurt him/her" is you denying your partner's agency, violating his/her trust, and by far the more abhorrent act than his/her deciding that you shouldn't be together.
When spouses discover things about one another's sexual history years or even decades after the fact that had been deliberately concealed, it doesn't just mean that the long delayed confrontation is now at hand. It means that, but it also means that they have to deal with the fact that their partners lied to them every day of those years or decades they've been together.
This is exactly the same sort of betrayal that one experiences when their spouse has an affair. Trust going forward becomes impossible in light of the extended deception. The vows are every bit as broken as they would be in the case of the affair, because the person they said "I do" about didn't have that incident in their past.
The fact of the matter is that you aren't entitled to either sexual partners nor life partners. You have to have the fully informed consent of another human being for that, and if you can't get it without deception, you go without. Anything else is just another kind of rape.