I don’t think a good aligned warlock who makes a literal deal with a devil due to extreme circumstances is beyond reason. It’s certainly not a great idea, but as a last resort desperate gamble I find it rather a compelling situation for role playing.