There's already a really cool python project called Pyro (python remote objects): https://pyro4.readthedocs.io/en/stable/intro.html
I haven't used it since I was in undergrad (>10 years) where I used it to communicate between nodes on a small cluster, but it made RPC really easy.