Did an internet search.
Found a LOT of sites that said don't do this. Don't rev the engine then turn it off. They said it was a silly idea that dated back to carby days, that people thought it "primed" the carb, making it easier to start the next time. But that what it actually did was send petrol into the cylinders that washed the oil off the cylinder walls and did harm.
Then I found one that specifically said to do it. And it was the instruction manual from a car manufacturer, Radical, for its SR8 engine. Its in the instructions for warming the car up in the pits before a day's racing. They say warm up the engine until water temperature gets to 50C, rev the engine to 6,000 rpm, then turn it off. No explanation is offered as to why. The implication is that a quick burst clears the plugs - it is a race engine not a road engine - and makes it more likely it'll start easily and quickly when you're ready to fire it up and go out onto the track. And having driven cars that idle roughly and foul their plugs easily because they're highly tuned that makes sense.