As it says on the tin. What if the Holy Roman Emperor called by many the Empire's answer to the "Sun King" survives/or never catches the smallpox that killed him in 1711?
Personally, I'd suggest the PoD to get rid of that syphilis. Joseph gave his wife Wilhelmine Amalia von Brunswick-Lueneberg that disease and it rendered her sterile. Get rid of the syphilis (Joseph got it from and I got this from Wikipedia so take this with a lot of salt, the daughter of a gardener in 1704), and the chances of a male heir for Joseph increases exponentially.
And, of course, if Joseph knows he isn't going to get Spain, he may not be so interested in hanging on to outlying Spanish possessions in Italy. So the Elector of Bavaria might find himself becoming King of Naples instead, with Bavaria going to Austria.
But here Joseph may be more inclined to that to accept. Except that it would mean disinheriting his brother Charles, whose Italian territories he would be bartering away. That's a bit of a tougher obstacle to overcome. Seems like it could only be done in a scenario where Joseph publicly and explicitly acknowledges Charles as his heir.
I don't think Karl/Carlos was overly concerned with the Italian inheritance being bartered away, since with the exception of Naples, he didn't seem to have a problem with the island-kingdoms. He bartered away Sicily to the house of Savoy at Utrecht, then after the Quadruple Alliance, he traded Sicily for Sardinia with them. And at some point he also was willing to set his cousin, Infante Manuel of Portugal, as the "king of Sardinia and Corsica". The idea fell through when the king of Portugal refused to grant his assent to the idea. Much like Joao V refused his consent for the infante to pursue the Polish crown later.
Just my two cents.
Interesting possibilities with this. Concerns about appearances aside, Habsburg expansion into Bavaria is advantageous if only as a buffer against future French intrigues. I do agree, Joseph, with his ambitions in Germany, may accept this.
How about Charles as King of Hungary then, expanding into Serbia and the principalities by conquest? Could this evolve into Kossuth's notion of a Danubian Commonwealth of Magyars, Croats, Serbs and Romanians?
Also would;t it be interesting to have Charles predecease Joseph in the 1730s? That way Maria Theresa inherits Hungary with little ado with the support of her uncle. Will she return the favor for her cousin when it's her time?
I remember seeing a TL - back when the world was young - where a surviving widowed Josef (who remarries and gets a son) splits the empire from the Hungarian inheritance, which goes to Karl VI. One of the terms that the split is guaranteed on, is that Josef's heirs have no rights in Hungary whilst Karl's have no rights in the Empire. I could see this happening - though the question is what happens to the Italian inheritance? Does it get ruled from Vienna or Budapest/Pressburg? And what happens if Josef and Karl both leave no sons?