core: optimize creation of hashtable "pointers" in eval_expression if argument is NULL

The hashtable is created on first call to eval_expression with pointers == NULL.
On next calls, the hashtable is cleared, then used again.
The hashtable is freed on exit.