Just to ensure you're aware: This is why Google made Starlark. You can think of it as just enough Python for the exact use case you talked about. Deterministic + hermetic is great.

https://starlark-lang.org/