Python scripts running in Kodi.



Hello, I am looking for someone to help optimize my python scripts that I have built in conjuntion with chatgpt. 

My use case is rather unique. I have several devices in chain as described below. 

Kodi HTPC GUI frontend
Denon AVR 4700H
Oppo 203
Panasonic OLED
All of my media is stored on my local NAS.
Both the kodi HTPC and Oppo 203 can playback the files from the NAS.

I have developed a few python scripts that run as services in my kodi environment. 
control203.py takes the currently playing file, extracts the base name and sends a get request to the oppo to play that file, at the same time, a subprocess runs calling another script udp203.py to change inputs to the Oppo 203.
I have another script running as a service that monitors the playback of the oppo 203. Once conditions are met, and a file stops playback for 1 second, the denon switches back to the kodi htpc and i can resume browsing my films with a nice GUI, I’m currently using Arctic Horizon 2. 
I am looking to speed up the control203.py and udp203.py scripts. Once I select a film in the Kodi GUI, the switch to the Oppo 203 input takes anywhere from 3-6 seconds and the get request takes another 1-5 seconds. On the otherhand, the monitor_playback.py script returns to 4700H to the Kodi GUI very quickly, in under 3 second, that does not need adjustments. 

Is anyone gifted in python?