53 x improve python tool

Performance improvement of "massSearchReplaceAnyInputTag()" (from Matti).