Should I replace my template math with python scripts?

Currently, I have MySensors devices sending raw data back, and I convert them through template sensors on Home Assistant. However, I’ve noticed since doing this, my CPU went from 0% to 2-10% usage. Not sure if it’s just a fluke.

But if I wanted to do the math in python instead (which would be MUCH easier than yaml anyway), would this actually run faster/more efficiently as well?