Is there a way to add a guard to a function declared with mx/defn?
no, but there's guardrails which supports that: https://github.com/fulcrologic/guardrails/