What does opencv `mean` function do when passing a mask of zeros?
The function cv:mean calculates the mean value of the marked out area in the InputArray as you said. So the function looks at the area which is filled with the mask (zeros) and calculates the mean value of the InputArray which is not filled with zeros. 

I know the code you are showing here. I don't understand why the function cv:Laplacian is used here because in my opinion this is not relevant in this case. Maybe someone else knows why he used the Laplacian array instead of using the blured_gray array.

I hope I could help you.