i just want to point out that permanent imprisonment also doesn't have to be particularly bad for the imprisoned person, we could totally just "imprison" people in a quite nice 4-room apartment and let them live as normal lives as possible while keeping them separated from others.
Let them get groceries delivered, have normal (if monitored) subscriptions and internet access, and go on walks with an actually friendly warden who just keeps an eye on them while actively trying to make the person feel normal.
even nordic prisons which are famous for being not inhumane are still quite terrible places to be, largely because we can't be arsed to spend more money than what we consider bare minimum to not qualify as torture.