As covered by an earlier QA here, there's not much evidence for the cyanide pill story.
Jim Lovell stated that they'd continue to try to solve the problem until consumables ran out, then vent their remaining air out to space for a quick and painless end. I assume most of the American astronauts would have felt the same way.
Andrew Chaikin, interviewing Lovell about Apollo 13:
Surprisingly, Lovell never felt as if he were staring death in the face.
"I think that as long as we had an option, it never really came up," Lovell explained. "If there was a chance to get home, you work on the plus side; you don't work on the minus side."
"We never would've thought about it [death] until all hope was lost," Lovell told me. "And then our idea was, if all hope was lost, if we went by the Earth -- say we missed the Earth. And we were on an orbit about the sun, if we had exceeded the escape velocity.... My idea was to hold off, you know, as long as we had options, as long as we could stand it, send back data.... We probably would have been farther out than anybody. And then, you know, then we would decide, you know, what to do.
"People often say, 'Did you [carry] a suicide pill?' or something like that," said Lovell. "You didn't [need] those. All you had to do was crank open the little valve to the hatch, there...
"Maybe we would have all committed suicide by opening up the vent valve," said Lovell. "And that would have been the end of the deal."