Debug printing of expressions

Is there a way to print out expressions to facilitate debugging?

For example if I wanted to do something like:
debug msg=“Here is an expression: ‘$last_result.find(‘Installed’)’ != ‘-1’ and ‘$package_installed.changed’”

No, though this works:

- debug: msg="the expression is true"
  only_if: $some_expression

Since conditionals are the only expressions you can do (and they have
to evaluate true or false), this is more or less the same thing.

Is it reasonable/feasible for me to develop an “evaluate” module for myself along the lines of:

name: Evaluate an expression and use result to indicate change

evaluate: expression=

e.g. is there an expression-evaluator (that e.g. only_if uses) that I can hook into?

Seems like this would need to be an action plugin.