Max M. answered 04/24/19
Harvard Literature major with 20 years of coaching writers
To add onto that--because I totally agree with Juliana--it is also true that Shakespeare was heavily influenced by medieval drama, which was almost exclusively religious plays. Growing up in Stratford, the theater he would have seen was traveling companies doing plays with titles like "The Play of the Sacrament" or "Abraham." Many of these plays feature extremely bloody scenes of torture, and many of those involve conversions. They're not long, so if you're interested, you might look up "Thais" by Hrostvitha of Gandersheim (though it won't be the most fun thing you ever read).
Anyway, this was Shakespeare's theatrical education, and there is a context in which, as hard as it is to believe, Shylock's forced conversion is a gentle and kind ending, since the plays Shakespeare saw as a kid would have, without exaggeration, spent the last act of the play just torturing and killing him.