effect isolation in Python, to facilitate more purely functional code