Book where an evil character is basically tortured/tormented into being a decent person on threat of pain/humiliation/death etc.?
I'm thinking along the lines of A Clockwork Orange, where the character is still evil to their core and only behaving decently (or even heroically) out of crippling pain (emotional or physical) that is inflicted on them either by way of psychological trauma/conditioning or some physical mechanism (like an electric shock or a spell/curse) whenever they do (or even think about) something evil or violent.
Another example I can think of besides ACO is Matt Fraction and Mike Allred's FF (a comic book), in which the punishment for the main villain (a ridiculously vain narcissist) at the end is to have his face scarred every time he does something cruel (via magic, which can't be concealed or undone) -- thus, deterring him from future criminal behavior, because his precious good looks mean too much to him.
To clarify, I'm not looking for a redemption story where something horrible happens to the bad guy once, he has a revelation, and then goes on to genuinely change as a person (e.g., Tony Stark gets tortured in a cave, this makes him realize how he's inadvertently contributing to violence against innocents everywhere, and he decides to be a better person). I'm also not looking for a story where the bad guy is doing it for personal gain (to make money, to have fun, to be popular, whatever). I'm specifically looking for a story where the threat of pain/discomfort/distress is omnipresent (or even the baseline state of being) for the evil character, and it either prevents them from doing evil (if the pain occurs during or immediately after the behavior) or forces them to do good (if suffering is the baseline that can only be relieved by actively being helpful or productive) even if they hate every minute of it, and are only doing it to escape crippling pain and not because they care about others.
A final example I can think of to illustrate what I'm looking for would be certain interpretations/adaptations of Charles Dickens' A Christmas Carol, where the character Scrooge is a bitter, mean, and selfish (but fabulously wealthy) old man who despises the poor, deliberately makes life hard on his employees, and goes out of his way to be nasty to everyone he meets. Long story short, at one point in the tale, he is magically granted the ability to see how people react to his future death, and seeing them be indifferent at best and relieved or even gleeful at worst creates great emotional pain and humiliation in him (as he previously believed that they feared and revered him for his wealth/power, not scorned him behind his back).
To relieve this pain, he behaves more generously and politely to everyone around him -- not because he actually cares about them as people, or because he has a moral revelation that he should be kind to others, but because the humiliation of people being happy about his death is too much for his narcissistic pride to handle, so he feels compelled to get back into their good graces even if he doesn't care about their wellbeing. His baseline after seeing people celebrate and mock his death is intense humiliation (emotional anguish) that he seeks to relieve by behaving better, thus improving his image to others.
(Yes, I know he had a genuine revelation in the original book, but at least one movie adaptation I saw as a kid didn't play it that way).
Anyway, any book with this element in it, even as a one-off or a side thing, would be greatly appreciated!