Multiple Users Connecting to an API Endpoint
This is best done by some asynchronous mechanism. The best solution will depend on your exact use-case.

Webhook - If user 1 and user 2 are other applications using your api, the simplest way would be with a webhook mechanism. Where user 1 and user 2 would subscribe to the api by depositing a url that your application calls with the results once both inputs are sent.
Polling - You provide an endpoint that both users need to poll to check if the api is ready to send back the results.
Email - You simply email both users the results once you receive both inputs. Or SMS, or IM message ...
Persistent connections - With a mechanism like websockets or http2 push. You can achieve this with a python application. But it this is the most complex solution and in most cases not needed.
I am attempting to write an endpoint in Python Flask that requires inputs from 2 users to run the function. I would like to have it so that user 1 would send a request with inputs to the backend and then wait for user 2 to send inputs as well. The endpoint would then calculate a result and output it to both users. What is the most efficient way to do this?