Maybe if you come here temporary, then buy 1 on darknet, then use it here.
Hell, there are wannabe gangstas here showing of their switches that can make a glock full-auto (and actually less effective in most engagements). An illegal gun purchase may be possible on the clearnet even, tho still kinda underground.
Maybe in the street with a dealer,
Not rly possible outside of US without criminal connections. Only in the US could a random thug get their hands on a glock right after jail. If you cannot do the paperwork or procedures in your country to get a gun just to ctb, and have to get it
illegally, it'd be much easier to visit US, get the gun, and ctb here. You don't exactly need to somehow smuggle it back home if your wanting to just shoot yourself.
With darknet, you either find out where the dealers are through ads, or organize a drop-off. It's never as simple as giving a location and bitcoin, only with narcotics and other contraband that can easily be disguised as something else totally-legal, but not firearms. You have to communicate and put your head in the game, you can't have your cake and eat it too. Make sure you're paying it with cash, shortly before, at, or immediately after the deal.
- + - + - + -
Alternatively:
A pipe, matchead powder, and a projectile could also be used to ctb aswel; as a deathrow inmate once did that, with playing cards instead of matchead powder (However I doubt the red-dye is still the some one that's partially combustible).