DETROIT — To cope with the gravest safety crisis in its history, General Motors has spent freely — almost $3 billion — to compensate accident victims and recall nearly 30 million vehicles.

But when the company closed the books this week on last year’s recall-plagued financial results, Mary T. Barra, its chief executive, had one more costly decision to make: Should the decade-long failure of executives, engineers and lawyers to address deadly defects in millions of cars result in a smaller annual bonus for G.M.’s blue-collar workers?

On Wednesday, G.M. chose to once again open its checkbook. For the first time since emerging from bankruptcy in 2009, when it received a $49 billion bailout from taxpayers, G.M. gave its 48,000 union workers a bonus greater than their contract called for.