Aral Balkan proposes using error-throwing functions as default values for required parameters:
To avoid that, you have to implement some sort of error checking yourself. However, doing so is rather verbose and adds noise to your functions. And so it’s rarely done. [...] What we’re doing is converting the required argument into an optional argument but specifying its default value as a method call that throws.