How to remove every inactive/unused screens in python?
I came across same issue and this was one of the only things relatively close, so I'd like to share how I cleaned up the screens that should be orphans in my Blender file.
So first to determine which screens were in use, open the outliner or add one to the current workspace and set it to &quot;data api&quot; view like this

Then once you have it open you need to expand the window or windows sections. So if you only use one monitor then there should only be one, if you have two monitors and have opened a new window then there should be one for each open separate instance window like here is mine.

So what we want to do is like I have in the screenshot is find the screen being used by each window and rename it. Now the reason I have named it the same as the workspace, is the window manager tab in api data is unique to each workspace.
So workspace name followed by master for main screen and slave for the new window secondary screen.
Then just work through each workspace, repeating the same above process, until we have all the active and open screens renamed. We can then check in the screens list to make sure we got all of them.

Like this, see all the leftover unused &quot;default&quot; copies, that should be orphans since they are from a &quot;new window&quot; I have closed but seem to still have a user.
Once we have done this all we need to do is manually force clear all the users for the unused screens with the python console, so open one up on any workspace and using this command swapping nameofscreen with the names from the above list.
bpy.data.screens['nameofscreen'].user_clear()

Now back to the to the outliner mode and this time switch it too orphan data and you will now see a list of the the orphan screens, hit purge, that will delete them from file. Then we can go back to the API data outliner mode and we should have a nice clean screen list like this.

This was done using a custom build version 2.9 alpha but should work in any 2.8+ versions.