better _trim_arity to avoid more costly try-test