The Torah says the following about a man who rapes a woman (Deuteronomy 22:29).
וְ֠נָתַן הָאִ֨ישׁ הַשֹּׁכֵ֥ב עִמָּ֛הּ לַאֲבִ֥י הנער [הַֽנַּעֲרָ֖ה] חֲמִשִּׁ֣ים כָּ֑סֶף וְלֽוֹ־תִהְיֶ֣ה לְאִשָּׁ֗ה תַּ֚חַת אֲשֶׁ֣ר עִנָּ֔הּ לֹא־יוּכַ֥ל שַׁלְּחָ֖ה כָּל־יָמָֽיו׃ (ס)
the man who lay with her shall pay the girl’s father fifty [shekels of] silver, and she shall be his wife. Because he has violated her, he can never have the right to divorce her.
The punishment is monetary compensation, a mitzvah to marry her, and a prohibition from divorcing her. The monetary compensation is a fine, which requires witnesses to impose. So if someone came to Beis Din and says he raped a woman, he'd be exempt from paying (see Kesubos 3:9).
I'm wondering however if the mitzvos on a rapist apply. For example, she wants to marry him but he's not interested, does Beis Din now force him to marry her (as they do with anyone who refuses to fulfill a mitzvah, see Kesubos 86a)? Or if they're married and he's trying to divorce her, does Beis Din prevent him? Do we say the principal of אין אדם משים עצמו רשע, a person isn't believed to incriminate himself (see Sanhedrin 25a)? Or do we say by his own words he has obligated himself in a mitzvah (similar to שויא אנפשיה חתיכא דאיסורא, see Kiddushin 65a).