To build upon your examples:
Case 1 Belief: "I don't believe student loan debts should be forgiven." Action: Accepts student loan forgiveness. Outcome: Hypocritical. Action directly conflicts with the belief, ergo the belief is not truly held.
Case 2 Belief 1: "I don't believe student loan debts should be forgiven for everyone." Belief 2: "I believe I fall in the category of people who should have student loans forgiven." Action: Accepts student loan forgiveness. Outcome: Not inherently hypocritical, provided Belief 2 is expressed alongside Belief 1. Not disclosing belief 2 makes the behavior hypocritical, as to an observer only belief 1 is held.
To link this back to the example of Musk, if he expressed his belief as "I don't believe most firms need subsidies, but the ones to my firm are warranted for reason Y" that would help avoid hypocrisy. To my limited knowledge, that is not the approach he takes.