I am not familiar with app_python3 that much, maybe @amessina or @aalba6675 have time to check it.
Based on a quick search on the net, starting with python 3.7 the use of PyOS_BeforeFork() and other related functions listed at https://docs.python.org/3/c-api/sys.html may be required to use in apps that do fork() like Kamailio.