I do love writing python, but it's pretty shocking when I find out you can write something like `event.__init__.__globals__[CONFIG][SECRET_KEY]`. That language just does not care about privacy or information hiding at all, I guess.
This is a great power, but also can become an unlimited source of bugs.
Don't let users run untrusted code. Full stop.
If you need templating use a sandbox like jinja2.
Edit: release notes https://www.palletsprojects.com/blog/jinja-281-released/
Conversely they don't prohibit expensive properties either (eg. ORM-based lookups), or generating misleading output or whatever.
2.4.0 :001 > a = 5
=> 5
2.4.0 :002 > gets.chomp
#{a}
=> "\#{a}"