You should use ccache 9, it will change your life!
You won’t need to do python3 setup.py clean before rebuilding, build PyTorch again using ccache, then make your changes, then build it again straight away.