Simplest way to limit current from MCU pin
Most integrated IC’s for flyback circuits have some form of current-mode control, where they use a shunt to read the current in the switch, and keep it from going over a certain threshold. This effectively acts like a series resistor, but it doesn’t dissipate power as if a real resistor was placed in series with it.
Depending on how robust / efficient you want to make this, that might be a path worth exploring, but if you are looking for a quick-and-dirty solution, a resistor would be the easiest way to do this.
Side-note: a gate resistor will not limit the current going into the inductor, because a switching power supply either operates with the signal going to the inductor on or off (not partially on as you are hoping to add an effective impedance).