A popular approach for Python web serving is to launch a number of "workers" (eg via gunicorn, etc), that hang around waiting to serve requests.
Each one of these workers in recently running code (here) idled using ~250MB of non-shared memory. With about 40 workers needed to handle some fairly basic load. :(
Rewrote the code in Go. No need for workers (just using goroutines), and the whole thing idles using about 20MB of memory, completely replacing all those Python workers. o_O
This doesn't seem to be all that unusual for Python either.
That said, Python devs are some of the worst engineers I encounter, so it’s not surprising things are being implemented incorrectly.
There seems to have been some recent-ish work on improving this, though: https://peps.python.org/pep-0683/#avoiding-copy-on-write
https://news.ycombinator.com/item?id=21831951
AFAIK part of the Teams API has been RE'd and is sufficient for writing an IM-only client, so it would certainly be an interesting exercise to do the same as above but for Teams.