May not be the reason for the caching thing, but still, need to change it. Forgot to mention the proper way:

```python
def some_function(template_vars=None):
    if template_vars is None:
        template_vars = {}
```
Or more succinctly: `template_vars = template_vars or {}`