If we examine Fair Credit and Reporting Act (FCRA), we see that it is not ok to discriminate against protected groups like race even if that means you're taking on more financial risk. Let's assume the data indicates that certain minorities are much more likely to default on a loan. You still cannot use their race to deny them a loan.
The reason is that it would perpetuate inequality. Given that minorities were systemically discriminated against previously by red lining by the federal government and could not get a federally backed mortgage in for decades (which resulted in Urban ghettos, white flight, etc). And given that those injustices have not been properly corrected, discriminating based upon race must be forbidden in the credit markets.
But you can discriminate using other variables. For example, you can discriminate based on education, income, credit history, credit score, etc. And some of those variables might correlate heavily with race.
In that scenario, you can use FCRA compliant variables even if they correlate with race as those variables are (a) cleared by the government, (b) derived from actual facts about the individual (as opposed to predictions). Otherwise, if you in your underwriting machine learning model accidentally find a proxy variable for race that isn't an FCRA compliant variable, your compliance department will require you to not use that proxy variable in your underwriting model.
Your argument "I'm taking on an extra financial burden" doesn't excuse you from ensuring fair access to credit. That's akin to saying "the cost of being handicap accessible is unfair to my business as it costs us money so I don't want to do it". We have made certain rules to ensure people have a fair shot in life and those inherently cause an increased cost to businesses.
Now, there is actually more nuance to this. For example, if you provide a credit product but you only make that product available in certain zipcodes, you could actually run afoul of fair credit laws if the zipcodes you include versus exclude are heavily correlated with race. However, if you are a very small business and don't have the resources to provide your services in all markets / zipcodes, then you likely would be ok simply because having to provide your services in the many places might be an undue burden on the business. However, as you grow and become more financially stable, you would/night need to fix that.