Accepting a forgiven loan is a different action - you don't believe the other person should have done it, but they did, your acceptance of that is a different matter.
Try rephrasing it into the negative: I don't believe anyone should pay sales tax. Is it hypocritical to pay sales tax when you buy something? No, it's not.
Let's play your example out in a conversation:
1: "I don't believe anyone should pay sales tax!"
2: "But you (someone who is anyone) do pay sales tax, are you a hypocrite?"
1: "Of course not. I have to, it's the law."
2: "So you believe nobody should have to pay sales tax, but they must when legally required?"
1: "Yes."
2: "Oh good, that seems reasonable. I also hate taxes."
Not giving charity while being opposed to subsidies is not hypocritical.
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.