Before drilling or gluing anything, I would put a paint-marker witness line across the metal shaft and the plastic fan hub. Pedal the bike under load and then check which side of the line has moved. That will confirm whether the hub is actually slipping on the splines.
If it is the plastic hub, solvent or brake cleaner could make the plastic brittle, so I would only use a plastic-safe cleaner after testing it on a hidden area. Glue is unlikely to be a permanent repair if the female splines are worn. A replacement fan/hub or a properly fitted mechanical collar would be safer. A through-pin may work, but it can crack the plastic and needs to be drilled squarely.
This guide is mainly about belt-driven bikes, but the load-versus-no-load isolation steps are also useful for locating drive slippage:
https://www.fitnessmachinehelp.com/exercise-bike-belt-slipping/
Transparency: Fitness Machine Help is my own website.