As for torture, in my view, they're simply saying that our goal is not really punitive because we're not actively trying to make prisoners miserable. Our incompetence, uncaringness and willingness to allow prisoners to be taken advantage passively creates misery, though.
No one is suggesting that we should torture anyone, only using it to point out that the prison misery comes more from apathy about prison conditions rather than some active attempt to create misery.
Explicitly mentioning that the purest form of retribution would be torture is (IMO) a way to argue that this ought to be a smaller component of what we do. Being sent to prison by definition involves a loss of some freedoms, it's not going to be pleasant. But exactly how unpleasant, this is at least partly within our control.
Why should it be any component of what we do? You don't have to be religious to recognize the need to call it unacceptable as a basic societal principle.
So you need to define torture, and then find a punishment which you find to not be torture and convince general society that it is both proportional and effective punishment for some specific criminal act.
It is unattainable because "perfect" is undefined for both the imprisoned and free people.
Arguments involving the idea of achieving perfect rehabilitation are the enemy of the good in this case. It's just as pointless to talk about perfectly repairing prisoners as it is to talk about perfectly repairing any of us. We're all variously damaged goods.
I agree with the GP that the system is designed for removal, but disagree that a system geared towards rehabilitation is impossible, if only by the existence proof provided by the number of people who have been rehabilitated to the point that they are no longer a danger to themselves and society.
I'm not sure what the GP thinks is the value that torture brings to the discussion, at least in societies that presume to operate on a foundation of human rights. Torture is literally psychopathic behavior, itself warranting punishment by removal via imprisonment. And with some notable and terrible exceptions, our laws back that up.