Fix Issue 6169 - [CTFE] pure functions cannot compute constants using functions not marked as pure

When running semantic on an expression used anywhere that forces compile time evaluation, use a scope flag to prevent purity and safety checks on function calls.
This allows better purity/safety inferrence as well.
Merge pull request #652 from yebblies/issue6169

Issue 6169 - [CTFE] pure functions cannot compute constants using functions not marked as pure