Found a solution.
Forced a cleanup before Python starts tearing down the logging module.
Import this library into the code:
import atexit
and add this at the end of the code:
def cleanup():
plc.disconnect()
plc.destroy()
atexit.register(cleanup)
After executing the script, the original error doesn't occur, and now we can remove the atexit portion of the code and execute like normal.