Oh wow, I didn't know that if you want to prevent os.walk from walking a specific subdirectory, you can modify the list of directory names it returns in place: https://stackoverflow.com/a/19859907
Not the most intuitive way to accomplish this, but definitely useful.