Had a space shuttle suffered a main-engine failure very early on during ascent, or had a time-critical emergency (for instance, a crewmember unexpectedly having a stroke) occurred before negative return,1 it would have performed an RTLS (Return To Launch Site) abort, whereby it would fly a normal first-stage2 trajectory, and, after the SRBs were exhausted and decoupled, continue straight downrange for a considerable distance before eventually pitching around, gradually nulling out its downrange velocity and acquiring considerable uprange velocity (losing a tremendous amount of altitude in the process), and finally jettisoning the ET and gliding to a landing back at KSC.3
This would seem to be a rather risky course of action, given that, if one SSME failed, especially early on, whatever took it out could easily knock out one or both of the remaining SSMEs,4 which would, for almost all of the standard RTLS trajectory, leave the orbiter unable to reach land; this would have been especially bad pre-Challenger-loss, when the shuttle crews had no bailout capability, forcing them into a likely-fatal ditching. The long second-stage downrange leg is especially odd, given that it would bring you further and further from safety at an increasingly fast rate.5 If anything, it would seem that one would want to avoid pitching over into the usual gravity turn, and instead fly as steep a flightpath angle as possible in order to maximise one’s reserves of altitude and minimise one’s velocity away from terra firma; failing that, turning to the north or south would keep one closer to a landing site than simply continuing straight onwards would, and would allow the final turn back to KSC to have been made via a bog-standard banked turn, rather than the supersonic vertical plummet of a standard RTLS (where the loss of even one additional engine could easily cause a loss of control). So why did the standard RTLS trajectory go so far downrange before turning around?
1: Negative return was the point in a shuttle ascent past which an RTLS abort would no longer be physically possible.
2: I’m going by the stage designations in NASA’s SS abort documentation, where “first stage” was before SRB burnout and jettison, “second stage” was from SRB jettison to SSME shutdown and ET jettison, and “third stage” was the OMS burn(s).
3: Shuttle launches from Vandenberg, had they not been cancelled, were planned to land at Edwards in the event of an RTLS, rather than back at Vandenberg (lots more room for error at Edwards, given that you can land basically anywhere on Rogers Dry Lake if you have to; this actually happened on at least one shuttle landing, which came down short of the paved runway and was on the lakebed for the first part of its landing roll).
4: This nearly happened on STS-51F), where a faulty sensor disabled one SSME and came within seconds of causing another to shut down before it [the sensor] could be deactivated. Had the second SSME been lost, Challenger would have come down in the middle of the Atlantic; as this was before bailout capability was added in the wake of STS-51L, the crew would have been forced to ditch in the ocean, and would likely not have survived. As it was, they were still able to reach (a much lower) orbit (known as an Abort to Orbit, or ATO for short).
5: Wikipedia claims that the extended downwind leg was to allow enough time to burn off all the propellant in the ET, but this explanation doesn't stand up under scrutiny; flying (nearly) straight up, or turning steadily to one side during the leg, would serve the same purpose, and not require killing off nearly as much downrange velocity or clawing back nearly as much distance from KSC.