Can 'Kumpel' ever mean 'boyfriend', as in, 'der Kumpel der Ex meines Bruders?
No, it can't.
"Kumpel" is something that is usually used only between men. It translates to "buddy".
If you call a woman or girl a "Kumpel", this is explicitly used to stress that you see her as a "good friend" (who you can drink beer or play darts with) but specifically are not in a romantic relationship with.
And it's the same the other way around: If a woman calls a man her "Kumpel" then it is also never meant in a "boyfriend" way.
"Kumpel" was originally a term that miners (people working under ground to get coal or metals) called each other.
This term slowly krept into every day German, first with the meaning of colleague even in other jobs, then as any kind of friend.
I would assume the word is much more common and it's heritage more well known in regions in Germany producing coal or metals.
It probably goes without saying that miners in the old days were men. The term therefor is most often used for men. Not neccessarily by men. But people would probably look funny in my region of Germany if a girl called her girlfriends "Kumpels". That's a guy thing.
So traditionally, the term means a male colleague or friend with absolutely no romantic or sexual meaning.
German does not have a word for boy/girlfriend and uses "friend" with enough context or eye-winking that it is understood whether it is a sexual relationship or just friendship. As you can imagine, this is an imperfect system at best.
"Kumpel" might be used to explicitely state that the "friend", which might be an ambiguous term, is indeed just a friend, not a boy/girlfriend.
Seid ihr zusammen?
Nein, er ist nur ein Kumpel.
Are you two together?
No, he's just a friend.
It would most the time mean the opposite. He's not a boyfriend, but just a good friend. Watch out for euphemisms and irony, though. People may say "Er ist nur ein Kumpel" with a wink either for teasing you or for telling it isn't something serious, yet.
As a native speaker, I don't agree with the other answer that it is only used between men. Women do call some kinds of friends "Kumpel" and more rarely people call female friends Kumpel as well. There may apply regional aspects how it is used as well, even when Kumpel is, in general, no regional word.
This might be a local thing, but I know "Kumpel" mainly as a word to describe a friendship that is rather superficial, as in, there are "Freunde" - friends that know you inside and out, and "Kumpels" - buddies that you like spending time with, but then it's stuff like going out for a beer or watching a football match, and it's not strange if you have never seen the inside of their homes.
As such, it doesn't matter if this is between two men or a man and a woman or (though rather seldom) between two women - but either way, being a word for superficial relationships only, this is not, absolutely never, a word for a boyfriend.
"Kumpel" is a word for "friend" which has a very strong connotation of meaning a platonic friendship.
In the German language, the word "Freund" can mean both "boyfriend" or "platonic male friend" (and by the way, the same applies to "Freundin" which can mean both "girlfriend" or "platonic female friend"). This ambiguity can easily lead to embarrassing misconceptions. So using the word "Kumpel" instead of "Freund" is very likely to specifically avoid that ambiguity and make clear that this person is indeed "just a friend".