I used to do it out of habit, but thought better...
I used to do it, rev and at the top of the rev, shut it down. I started thinking about it and have since reconsidered.
The rev causes the engine to get more fuel as you have asked for more power. The mixture goes rich, according to the map of fuel and throttle position.
Unfortunately that probably allows fuel to collect on the cylinder walls and elsewhere, which then stays there because you have turned off combustion when you turned off the key.
I think I probably want to leave the cylinder walls coated with oil and not gas. The next time I start up is hard on the engine, as all start ups are, due to the lack of lubrication. Having the cylinder walls wiped clean with fuel rich mixture leaves them particularly vulnerable.
Just my thoughts and I have nothing to back them up. Now I just let my motor idle for a minute and then quietly shut it off.