Our Gemara on Amud Beis discusses the concept of Takkanas Hashavim, a special allowance made for a penitent. Usually, if someone stole an item he is not permitted to merely pay the owner for the object, but rather he must return the object, so long as it has not been materially transformed into a different object, such as stealing wool and making it into a garment. Thus, a thief who later wants to repent can sometimes find himself in a predicament, if what he stole has not been transformed, and yet still has become deeply embedded in a structure. The Gemara describes a scenario where a thief stole a large wooden beam which became the supporting brace for his home. The beam was not changed or transformed significantly, though now built into his home, and therefore according to the letter of the law he must dismantle his home and return it to the rightful owner. The rabbis felt that certain Torah laws can ask more of people than, at least, people of their current times could bear. Thus to facilitate and encourage repentance, they allowed the thief to keep the beam and discharge his liability by paying for it. The owner cannot compel the thief to dismantle his construction project. 

Rav  Elchonon Wasserman (Kovetz Ma’amarim 17) observes that the Rabbis were not inventing a whole new idea conceptually. Rather they were expanding on a pre-existing Torah sensitivity. The fact that the Torah does not require a thief to return a stolen object that was significantly transformed might be an indicator of this ethos. Rav Elchonon argues that the Torah realizes that once a person invested his energies and creativity into transforming something, such as weaving a sweater out of stolen wool, it would be too hard to return and thus he can pay. The rabbis merely extended this concern due to their sense that the contemporary average penitent could no longer bear the test of removing the beam.  This has been the role of the sages, as guardians of the law, who occasionally rely on technicalities to effectively make new legislation in order to preserve the law's overall function, as we see in regard to the Pruzbol (Mishna Gittin 4:3). (In our case they rely on the principle of Hefker Beis Din Hefker.)  Even when the sages make such interventions, they seek some precedence within the law already, as also expressed in the principle כׇּל דְּתַקּוּן רַבָּנַן — כְּעֵין דְּאוֹרָיְיתָא תַּיקּוּן verything the Sages instituted through their decrees, they instituted similar to the model established by Torah law (Pesachim 116b.)

Reflecting upon this, I will share a psychological derush.  Sometimes we develop habits and personality features that came from sin, but our defenses and perception can be so baked into our character that it is almost impossible to remove them without tearing down the entire structure.  Is it possible that sometimes God is merciful, and allows the penitent to somehow integrate and repurpose the “psychological contraband” into a useful personality feature, even if it was ill-begotten?  For example, a suspicious, paranoid or pessimistic person could perhaps learn to use that quality for better purposes instead of getting rid of it entirely? Or could a sensual  person who engaged in debauchery keep his or her sensitivities and appetites, but redirect them for more constructive purposes?  I don’t know if one can always succeed at that, and perhaps sometimes a person needs a total demolition of self before being able to rebuild. Still, we can hope God has mercy and guides us to change without too much painful destruction.