Can you clarify if you are doing this at Load Time (in Load Script) or at Run Time (on a Sheet, after user’s make selections)? This may be helpful to the answer.
Secondly, you state that you are sending a lot of data in, but are you also getting a lot of data back or just a small set of data? For example, IN: 10,000 rows * 4 columns (40,000 elements) vs OUT: 10 rows * 1 column (10 elements).
If you answered Run Time (#1 above) and a low result set ration (#2 above)...
Then I would suggest that you see what options exist to improve your python script. For example, you might be able to reduce it to only use 2 columns (date, serial), then have your Python script access the Name/Values (if needed) from a CSV file on its own. Doing this would reduce your IN: to 20,000 elements (above) which would significantly improve performance for your users.
Of course, the CSV file could be created by your Load Script during data updates so that it is always consistent with the Qlik App and up to date.
Hope that helps.