There seems to be other posts from the past where people have managed to get Audacity and Python to play nice. Since your 4000+ files are MP3 files, and not Audacity project files, could you expand on what you mean by ‘cleaning up’? Can you accomplish what you need using Python alone?
Is there anything in this post that might be helpful?