Change argument from by-value to to reference to const.

Avoids an unnecessary incref/decref of the internal PyObject pointer
when it is copied and destroyed.
Refs #8000
Merge branch 'bugfix/8000_python_instrumenttest' into develop