This is true but I don't think it meaningfully checks the president, because the pardon power is also absolute and unreviewable, and does cover courts martial (as we saw in the Eddie Gallagher case). Military personnel are not required to follow illegal orders from the president, but if they do they won't face legal sanction.