for loop in one line (for python -c)
If you need to use python for being crossplattform and if you need to do this in one line then this is the way to go, yes.
For some reason
Alternatives to consider:

put the code in a file so you can make it more readable
create a Makefile and run this under a target (like clean:)
use os instead of pathlib to see if you like that better (pathlib is fine, though)
use map and a lambda instead of list comprehension, to see if you like that better (probably not though)

I would have expected that a one-line for loop would work, but it doesn't seem to in python -c when there is a command before it.
I think there is no much cleaner solution