Osama bin Laden is a great example, because it could have gone horribly wrong and made Obama look terrible. The other two are really lousy examples, for two reasons:
1. Gay marriage and the auto bailout are or have been unpopular, but not among Obama's core voting groups. Yes, standing behind those positions will piss off lots of people, but not people who were going to vote for him anyway. The ACA falls under this category as well, in that it wasn't terribly popular, but many on the left didn't like it because it didn't go far enough. No way were they going to vote for Romney because Obama hadn't gone far enough with the ACA.
2. Obama didn't come out in favor of gay marriage until Biden forced his hand, and there's no way he would have. But Biden forced his hand and it turned out well for him in the end.
Obama is just as calculating and concerned about keeping his base happy as any other national politician.
To say the ACA "wasn't terribly popular" is a huge understatement.
The amount of $$$ spent against "Obamacare" before and after its passing easily numbers in the hundreds of millions of dollars. "Obamacare" is/was considered a defamatory label. The president's Chieff of Staff essentially begged the president not to go through with it. 0.00000000000000000 Republicans ever went on board with it. The whole law wasn't even to go into effect until 2014. Presidents for how many decades have tried and failed to deliver health reform?
There was absolutely no short-term (or even near long-term) political gain to be found in pursuing the law. And if the law didn't pass, the president would be in a much weaker political position.
Even by passing it, the president knew the process would kill any remaining political capital he had left and also hand the House of Representatives to Republicans. That much was not rocket science.
What is amazing is that he chose to pursue it anyway. It's even more amazing that the law passed given all the political and entrenched forces against it.
So, to be clear, the ACA was emphatically not popular in any way. I still remember all the anti-Obamacare ads that showed up on Youtube videos. The law was villified to kingdom come and it would be a tragedy if that fact is forgetten.
The president bet all of his political capital, the House of Representatives, and potentially his entire presidential career on passing 'Obamacare'. I don't know of a better example of acting in spite of the political ramifications.
I'll agree that he dragged his feet for the right moment on gay marriage but the auto bailout could have SO easily gone the wrong way and Obama would be married to it. As in, he's catching the blame for decades of business decisions, in exchange for trying to help. But he did.
Are we sure the auto bailout hasn't gone the wrong way? The problem with bailouts are two-fold:
1. They protect jobs, but often at a much higher cost than is justified. Admittedly, I don't know the numbers here, but I recall something about the ban on foreign tires protecting US jobs at a cost of $900,000 per job saved.
2. They introduce moral hazard. See our repeated pattern of bank bailouts for examples. If the auto bailout did cause this problem, we won't know about it until much later.
A defining feature of capitalism is competition, which means economic winners and losers. If we protect companies from the need to restructure, even for a noble purpose, we may cause more problems down the road. The auto industry wouldn't have ceased to exist if two companies had gone through bankruptcy. Other automakers and manufacturers would have bought those assets and run them more efficiently. And those other companies are exactly the type you want to be doing this, since they didn't need a bailout in the first place, right?
That's a longer term than political success/failure and a different conversation.
I don't think the moral hazard argument holds for the auto industry like it does for banks, and the auto industry is strategically critical to have around and in good health. But there are valid arguments that disagree.