It's unclear whether the carve out for prisoners applies to just "involuntary servitude" or "slavery and involuntary servitude."
In practice, only "involuntary servitude" has been used. "Community service" - unpaid - is a very common low level sentence.
The eighth and fourteenth amendments almost certainly forbid enslavement - permanently becoming human property - as a criminal sentence.
Even before the 13th amendment, enslavement as a punishment not common, if it happened at all.
There is almost no case law on the 13th amendment. There are no legal slaves in the US today, and there have not been since the 19th century.