The least harmful way to improve hiring outcomes for qualified individuals from historically marginalized groups is to increase their representation in your hiring pool. That's fundamentally it.
This means making the effort to recruit at e.g. career fairs for Black engineers and conferences for women in STEM in addition to broader venues, and to do outreach at low-income high schools that makes it clear to bright kids trapped in poverty that there is a path to success for them.
The "clean" solution you have presented IS the lazy route.