chore: make eval_constants
a pure function
#3027
Merged
eval_constants
a pure function
#3027