What's the specifics of your project? Complete details will help us help you much better.
Regarding motor axles:
There's quite a few different types of axles in hubmotors, but most of them are solid on the non-wire side. On the wire side, most, but not all, have a hole machined in them *somewhere* for the wiring to pass thru. How, where, and what shape that hole is varies, so you'd have ot check your specific motor to find that out for it.
Some of them are hollow all the way from jus tinside the bearing to the end of the axle, with wire exiting the actual end of the axle.
Some use a diagonal hole from just inside the bearing to just outside the bearing.
Some use a channel along the "surface" of the axle from just inside the bearing to just outside the bearing. This channel can be just as big as the wire, or it can be a completely flat area.
But all of these leave structural weakness in the axle, which along with the fact that most of the axles are made of a metal commonly called "chinesium", meaning it's composition and treatment is unknown, but insufficient for the purpose to which it is being put. It's not unheard of for there to be casting and machining defects in them, and most certainly design flaws (lots of sharp transitions that make for perfect stress risers, for instance).
Some that don't use hollow axles use a spacer ring between bearing ID and axle OD, with holes thru the ring for the phase, hall, and any other sensor wires. THis type of axle is generally (potentially) a lot stronger than the others, because it doesn't have the weakness of a channel, cut, or tunnel thru the axle.
But almost all motors still use the very tiny surface-area of the flats of the axle to transmit all that torque, typically thru dropouts and torque arms that aren't really made well enough for the purpose. Some use integrated torque arms, which bolt to or otherwise more-securely interface to the axle shoulder face, or a face inboard of that, and those can take a lot more torque and are much less likely to fail under normal usage (much less "overclocking" / "overvolting" / etc).
It is also possible to use a completely hollow tube for an axle, and be strong enough, without passing the wires thru it and without having it actually have to take the torque, by using the spacer-ring and integrated torque arm approach at the same time. Grin Tech's All Axle Hubmotor does this, for example.
You can look up "broken axle" or "spinout" and other similar things here on ES and find plenty of pics and whatnot of failed axles, and the situations that caused them, if interested.