I've said it before and I'll mention it again.
There is no evidence that the entire crew of the Excalibur was killed by M-5.
From the time Excalibur takes its final phaser hit (and what looks like a huge radiation flash occurrs) and the time M-5 says that there is "no life" (aboard Excalibur) aboard, there are several minutes. More than enough for surviving crew members to have abandoned ship.