I could show up at your doorstep, declare myself at your service, and then spend the rest of my days catering to your every beck and whim. There's no law against that. Can it even be slavery if it's voluntary?
1. Contract terms that require committing a crime are void and unenforceable.
2. "A contract made me do it" is not a defense to a crime.
3. "The victim gave me permission" is not always a defense to a crime.