Could a massive EMP save the planet

Could a solar superstorm or a distant supernova wipe out all of our extraterrestrial technology?

Some past extinction events are believed to have been caused by gamma-ray bursts or nearby supernovae plunging the earth in energetic radiation. Now the amount of radiation is enough to penetrate the Earth's magnetic field and strip the ozone layer and bathe the planet below with energetic ultraviolet radiation from both space and the sun, but not enough to melt stone or set forests on fire put, so the actual physical damage will be limited.

This leads to a second problem. Space structures and colonies are already heavily armored against radiation from cosmic rays, solar flares, etc., unless they are built in places like Earth orbit, where they are in the planet's magnetic field. The general rule is that a space colony would need the equivalent of 5 meters of slag or water to stop the incident radiation and this would also provide armor protection against micrometers, small space debris, etc.

In order to cause the kind of damage that the operating room demands, a massive amount of radiation must be directed towards the solar system, which for me suggests the "beam" of energetic radiation associated with pulsars.

Scheme of a pulsar

The highly charged beam is dangerous because it is narrow and highly focused, which leads to another situation in which it misses large parts of the solar system. Random survivors are found wherever there is suitable shelter and where the ray has passed harmlessly without interacting with the shelter or body in space.

The other problem is that there is no suitable astronomical body in the vicinity of the solar system to either already be (although you would need to rationalize how the axial tilt of a pulsar can be changed to "aim" at Earth) or a star capable of becoming a Type II supernova and leaving a pulsar as a stellar remnant. Anything further away than @ 10 Ly will likely be too far away to maintain a focused beam with enough energy to harm the solar system.