If you don’t wish for an event to be in 3D you can simply delete the FMOD Spatializer plugin from the event.

Once an event is made 3D you can’t really “make” it 2D through code. You can try overriding the event’s default 3D min & max distance settings, however this may still sound 3D due to the upmixing to the spatializer’s output format.