I'll still stand on the idea that the solution is to initiate an air-share and THEN ascend. The reason is that at the time the freeflow occurs, you are (hopefully) stable at a depth, AND you have something to breathe. You can signal your buddy, and he can fumble around finding his octo and getting it to you, and the stress isn't too high because you STILL have gas. If you initiate an ascent while breathing off the freeflowing reg, you're entering into an unstable state (ascending) where it is much easier to get separated from your buddy, and you have no idea WHEN you will run out of gas, and when you do, getting gas from your buddy has just gone from an elective action you can execute deliberately, to an emergency action which must be carried out perfectly and FAST.
Turning off the valve is optional; it preserves some gas in the tank, but that gas probably won't be usable by the diver, as few people can turn their own single tank valves on underwater. (It's possible, though!) What shutting the valve does is calm the situation, because the incredible noise and visual disturbance goes away.