You can use Godot for 2D without removing the 3D parts. I don't think it will make much of a difference performance wise since they are separate. For example, if your base node in your Scene is a Control or Node2D, then the 3D portion of the engine won't be running. The only need for doing a custom compile is if you are deploying to mobile or other low-end devices where the file size matters a lot. Even so, the whole engine is around 40MB with everything, so even hardware from 5 or 10 years ago will work fine out of box.