Cessna had a placard on some of their airplanes that warned you "Do not turn off alternator in flight except in emergency." I believe it was related to the advent of electronic voltage regulators. The rotor in an alternator is the field, and is a husky coil of wire on an iron core. Like any such coil, it is also an inductor and when the field current is abruptly cut off it generates a voltage spike. The old electromechanical regulators didn't much care about that spike, though that spike is also fed back to the alternator's output terminal, since that's where the field current is taken from, and if the diodes in the alternator are a bit marginal you might burn one out. Electronic regulators use a power transistor to regulate the field current, and semiconductors are generally much fussier about being spiked. In the flight school we were getting electronic regulators to replace the old, failing units that the airplanes were built with in the 1970s; electromechanical regulators aren't built anymore. Those electronic regulators were failing at an alarming rate, and I suspect that some instructor was demonstrating or teaching to check the alternator by switching it off and on in the runup. Used to be able to get away with that, but not now.
That was ten years ago. Perhaps the makers of regulators have installed Zener diodes or MOVs to shunt that spike and it doesn't matter anymore. I don't know. Even if they do, you still have the avionics to watch out for.
Some pilots argue that we can't switch automobile alternators off and on, thinking that they are fired by the ignition switch, and so we can't hurt anything in the airplane if we turn it off and on while the engine is running. Those guys don't understand that the car and airplane are wired differently. The car's regulator is turned on by the alternator stator, which generates a small current when the alternator starts turning; that's caused by residual magnetism in the rotor. That is fed to the S terminal on the regulator to close the internal relay (or semiconductor shutdown switch) and allows current from the A terminal, which is connected to the alternator's output, to flow through the regulating circuitry to the field. In such an installation, the alternator is not on at all until the engine is running. When we shut the ignition switch off, the alternator spools down and the regulator opens and a spike can be generated, but with the ignition off it can't reach electronic stuff.
In the airplane, now, that S terminal on the regulator is connected to the ALT switch so that we can shut the system off in case of malfunction in flight such as a stuck or shorted regulator causing massive overcharge, or if the alternator has failed (broken belt, maybe) and we want to stop losing field current through it to save the battery for more important stuff.