fix: improve `evalInt?`

This PR improves the `evalInt?` function, which is used to evaluate
configuration parameters from the `ToInt` type class.
This PR also adds a new `evalNat?` function for handling the `IsCharP`
type class, and introduces a configuration option:
```
grind (exp := <num>)
```
This option controls the maximum exponent size considered during
expression evaluation. Previously, `evalInt?` used `whnf`,
which could run out of stack space when reducing terms such as `2^1024`.

closes #9427
7 files changed