40 years ago, I was educated as a mechanical engineer. What you propose is high risk. The heat treatment of a stock axle is likely acceptable but not uniform from surface to center. If you shorten the axle, you're digging into the heat treatment with unknown consequences. You're playing with fire.
If there's any way at all you can acquire a new unmodified axle, do that instead. If you use a modified axle, don't drive too fast. A few passes on the drag strip may be OK but don't drive the vehicle tens of thousands of miles.
Several years ago I broke an axle going 70 mph on a state highway. Very fortunately the disc brake caliper on my disc brake conversion held the wheel onto the car rather than allowing the whole rear body to belly drag (it was a totally awesome blue smoke screen as the tire disintegrated going from 70 to 0.) Without that disc brake conversion holding the wheel in place, the car would have been totaled.
Doing the forensics, it was very clear someone had removed the rear axle bearing with a cutting torch and left a very small nick in the axle surface. Over 20,000 miles of rotations of reversed tension and compression cycles, that tiny nick had worked its way though the entire axle until it broke.
Just saying that hardened steel, like axles, is extremely difficult and unpredictable to machine. You really need to do the heat treatment AFTER machining.
When I'm betting my life, I tend to be conservative.