I think that’s really more of a general python question than a streamlit question, but I don’t think you need to be concerned about different users ending up with each other’s context.
Here’s a post that may be relevant Make apps faster by moving heavy computation to a separate process