Run a Python script as subprocess from Slicer

You can get definitive answer by using a Python profiler, but a likely root cause is excessive logging. See more details here: