We have to admit that 380 class motor pinion is indeed a frustratingly tricky situation to what should be a simple problem. During motor replacement, most of the time the only option for a pinion is to try and prise the stock press fit ones off the stock motors and fit them to the new ones. This can be very difficult. 3d print is another option but failure rate is high.
Brushless 380 motors come with 3.17mm shafts but brushed ones use 2.3mm!
Some smaller motors like the 380 may not have D cut on the shaft so the pinion must be forcefully inserted. Plastic gear just won’t stick to the shaft firmly due to the absence of hex screw. Super glue cannot help much either. The shaft hole of the plastic pinion will eventually get enlarged and loosen.
There is an exception – the gear can sit tight if the motor shaft has a surface with rough pattern on it (i.e. knurled shaft). Use it together with super glue then the plastic gear can be reasonably secured:




