I do not value loyalty over ethics, especially when it comes to sexual assault. Being my friend doesn't mean I will ignore or excuse what you do to someone else, even if it is someone I dislike or don't trust.
I also do not throw people away without being sure that I should. People make mistakes. Literally everyone who has sex will make some kind of consent mistake at some point.
So to bring these things together:
When I learn that someone I am friends with has violated another person's consent, I feel it is my responsibility to reach out to my friend and say "please explain." Then from that explanation (or lack thereof) I will decide if my friend's actions make them an unsafe person or not.
A safe person:
1) made a mistake, which was not a conscious choice to disregard the other person's boundaries
2) responded to learning it was a mistake by sincerely apologizing, offering to do whatever they can to help the victim in the healing process, and changing the way they interact with all people to prevent it happening again.
An unsafe person:
1) made a boundary-violating choice on purpose to try and get the victim to do something they would not want to do if they had all the information, or something they clearly expressed not wanting
2) responded to learning it was a mistake by trying to explain it away or defending the choice
3) did not offer or did not follow through on what the victim said would be helpful
4) did not change the way they interact with all people to prevent it happening again.
If my friend didn't realize that they should do 2, 3, and 4, but is willing and does something like those after I mention it, I would not consider them unsafe. If they are not willing to do these things they are no longer my friend.