Did your function just mod the state?
Context
In Emacs lisp
shell-command-to-string function in Emacs is not a pure function, because it has side effects,
such as executing a shell command and potentially altering the state of the system.
In contrast, adding to the exec-path is considered an impure function since. it modifies the
environment by changing the list of directories where Emacs looks for executable files.
This post ll also observe the interopeability aspect1