What about ( sometimes multiple ) lifetime sentences without release? Sure they try to rehab* the inmate but not to the point of releasing them.back out to the public. Granted this is just one scenario..
Countries that have a very high focus on the 'rehab' part of prison usually don't issue lifetime and certainly not multiple-lifetime sentences. Instead they tend to send people into mandated psychiatric care (in practice often life-long) or, if a person is 'sane' yet still very likely to cause damage to others than they are placed in 'preventive detention' which is still just 'being in prison' but does not carry any punitive notions and needs to be actively renewed every few years.
I suspect a lot of folks would say skip rehabbing that person and try to deal effectively with a person who is getting out. There isn't an infinite amount of money and the extra little bit spent properly might make the difference between productive citizen and career criminal.