@lisamelton @fahrni @kdawson To add: It would make exchanging patches with other WebKit based projects virtually impossible.
Things one *may* consider is to write new components in Swift or use something like SwiftUI for the interface. Things that are *relatively* easy to iterate on and where Apple has full control and can move fast.
In addition, one can try to tighten the knobs on any C++ code base, enforce a more restricted set of C++ that tries to prevent certain classes of bugs. Changes themselves can be applied on the whole code base using e.g., Coqinelle but must be carefully reviewed and tested each time for regressions. Even that will be a huge undertaking. And I bet Apple already has done quite some measures to ensure a high quality code base here.
(The only reasons for me not to use Safari on macOS are a) no uBlock Origin for not even that bad reasons but the alternatives don't really cut it for me, and b) no tab groups.)