Like Musky says, the key is for alignment, and in the grand scheme of things cannot be considered as the means of power transmission. That's the job of the friction on a taper or the clamping force of a fixing as in the case of the crank pinion oil pump drive or camshaft nut.
The hardness of the key ( in my opinion) can be softer than the machined components and will limit damage to these parts in the case of a disaster.
Sheared keys are more a sign of poorly fitting parts or the inadequate tightening of the fixing.
As kids we had a Hercules Grey Wolf Moped as a field bike. We clubbed together and punted the 15 bob the local shady dealer was asking. It was a poor runner, with the usual problems of intermittent sparks. The magneto points were behind the forward facing flywheel, and it took Dad's expertise (Puller and a big hammer to smack the puller ) to get if off the taper. We kids reassembled it, started it up and after a few minutes running sheared the key.
Dad came to the rescue, pushed us aside and made a key from the bottom corner of the garden spade. Then with a tubular jack handle on the end of the puny spanner, showed the nut, flywheel and taper who was boss. Lesson learnt. Tapers need to be tight. Gearbox mainshaft taper is a case in point on S/A Models. Here the key slot is often found to be damaged, the key has been taking the drive, not the taper. That clutch centre nut needs to be gut busting tight to avoid trouble and care take to ensure the nut is pulling the shaft and centre together and not just bottoming out.
Dad had been an aircraft engine fitter, area of expertise Rolls Royce Merlin engines on Spitfires and Sunderland Flying Boats......The Hercules had no chance. That bike was followed by a James 98 with girder forks. Scrap man had that. Oh! the foolish errors of youth.
Swarfy.