On the f-18, Max speed is not related to pylon drag. It's related to air flow to the engine.
Max speed at sea level may be affected by pylons, but absolute max speed is limited by the lack of inlet control surfaces.
Air supersonic relative to the compressor face cannot be compressed by the engine, which is why aircraft like the f-15 and f-14 and sr-71 have moveable surfaces that control the shockwaves to make sure supersonic air decelerates (which adds a ton of "pre-compression" by the way, making less work for the engine). As speed increases, those shockwaves move inside the inlet and approach the compressor face... without moveable surfaces to control them, the f-18 engines, although powerful enough to accelerate it beyond mach 1.8, cannot be fed with air beyond that speed. No air compression = no thrust = limited speed. BAsically, supersonic air causes compressor stall, so you have to slow it down before it hits the front of the engine inside the inlet.
This explains with images and video (worth 1000 words):