In Chapter 2 of the Mishnah Torah on Repentance, the Rambam presents an achingly romantic view of "Complete Repentance" (doubly romantic as it involves love between both a man and a woman and a man and Hashem):
אֵי זוֹ הִיא תְּשׁוּבָה גְּמוּרָה. זֶה שֶׁבָּא לְיָדוֹ דָּבָר שֶׁעָבַר בּוֹ וְאֶפְשָׁר בְּיָדוֹ לַעֲשׂוֹתוֹ וּפֵרַשׁ וְלֹא עָשָׂה מִפְּנֵי הַתְּשׁוּבָה. לֹא מִיִּרְאָה וְלֹא מִכִּשְׁלוֹן כֹּחַ. כֵּיצַד. הֲרֵי שֶׁבָּא עַל אִשָּׁה בַּעֲבֵרָה וּלְאַחַר זְמַן נִתְיַחֵד עִמָּהּ וְהוּא עוֹמֵד בְּאַהֲבָתוֹ בָּהּ וּבְכֹחַ גּוּפוֹ וּבַמְּדִינָה שֶׁעָבַר בָּהּ וּפָרַשׁ וְלֹא עָבַר זֶהוּ בַּעַל תְּשׁוּבָה גְּמוּרָה. הוּא שֶׁשְּׁלֹמֹה אָמַר (קהלת יב א) וּזְכֹר אֶת בּוֹרְאֶיךָ בִּימֵי בְּחוּרֹתֶיךָ
What is complete repentance? He who once more had in it in his power to repeat a violation, but separated himself therefrom, and did not do it because of repentance, not out of fear or lack of strength. For example? One who knew a woman sinfully, and after a process of time he met her again privately, and he still loving her as theretofore, and he being in a state of potency, and the meeting is in the same land where the sin was first committed, if he parted without sinning, he has attained complete repentance. Of such Solomon said: "Remember then thy Creator in the days of thy youth" (Ecc. 12.1)" (Translation from Sefaria)
What, however, would be the logistics of such a demonstration of complete repentance? Would yichud be required? If so, would one get a "pass" for committing this transgression in order to seek complete repentance? If one or both parties had divorced in the meantime, would the repentance be any less complete?
If yichud is required, would that not be a serious transgression of the following principle set forth in Avodah Zarah 17a (as well as elsewhere):
עולא כי הוה אתי מבי רב הוה מנשק להו לאחתיה אבי ידייהו ואמרי לה אבי חדייהו ופליגא דידיה אדידיה דאמר עולא קריבה בעלמא אסור משום לך לך אמרין נזירא סחור סחור לכרמא לא תקרב
The Gemara relates: When Ulla would come from the study hall, he would kiss his sisters on their hands. And some say: On their chests. And the Gemara points out that this action of his disagrees with another ruling that Ulla himself issued, as Ulla says: Mere intimacy with a woman with whom one is prohibited from engaging in sexual intercourse is prohibited, due to the maxim: Go, go, we say to a nazirite, go around, go around but do not come near to the vineyard. Just as a nazirite is warned not even to come into close proximity of a vineyard lest he consume a product of the vine, so too one is obligated to distance himself from anyone with whom intercourse is forbidden." (Translation from Sefaria)