compiler: Small optimisation of assertM
In #22739 (closed) @AndreasK noticed that assertM performed the action to compute the asserted predicate regardless of whether DEBUG is enabled. This is inconsistent with the other assertion operations and general convention. Fix this.
Closes #22739 (closed).