Prop gun, squib, lighting, camera angle, and editing to help sell the illusion. A sound effect in post. And never a real gun, never real bullets anywhere in the production, never a squib fired at close range towards anyone in the cast or crew. That's how I'd do it, if I didn't have the tech or the budget to do something more explicit.*
Moviemakers are well familiar with all the techniques of telling a story on screen, without actually showing what the budget or the technology will not allow. Any film school graduate can compose a scene in such a way that everything but the muzzle flash itself is shown, and every viewer comes away with the impression that they actually saw the gun fire. How many people could have sworn they saw a man's ear get cut off, on screen, in Reservoir Dogs?
This idea that filmmakers always try for the most physically accurate depictions possible is a laughable canard. There's tons of things on set that are obviously shallow, hollow fakes, that only look believable on camera, from a certain angle, with specific lighting. There's tons of things we see on screen that we know aren't realistic, but we accept them as real in the context of the story because they look believable in that context.
Top Gun didn't actually have Maverick fly an F-14 inverted over a MiG-28. The MiG-28 isn't even a real plane. But people still accept that's what they saw happen in that scene. Sam Raimi didn't give Tom Holland functional web shooters so that he could do real web-slinging travel among the skyscrapers of Manhattan. We all knew it was fake. It even looked fake a lot of the time. But we accepted it without question, because literal realism is not actually a highly valued thing in cinema. Never has been, never will be.
Filmmakers who go for literal realism are indulging a personal and unnecessary quirk, often to the detriment of the production. They're not upholding some general principle of good filmmaking. They're not even delivering what the viewers actually want.
---
*Speaking of explicit, if literal realism is so important, how come we never see people literally copulating on camera, in sex scenes? How come so many movies are able to believably convey the idea that two characters had sex, without even showing a simulated sex scene?