Alternatively, the code could be written in the style of parse, don't validate[1]. However I've never had a coding LLM preemptively suggest that.
[1]: https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-va...
[1]: https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-va...