How does P4O10 make sense? I'm trying to understand the gains phosphorus has from forming $\ce{P4O10}$. The molecular structure is such that every oxygen atom forms two bonds (either two with one phosphorus atom, or one with two), while every phosphorus atom forms five bonds.

I'm clear about the gains the oxygen has from this -- it fills its outer shell to the octet rule, mimicking neon effectively. But what about phosphorus? We're talking about a covalent bond, so forming five bonds would leave it with five extra electrons, which is two more than it needs to reach an optimal configuration.

I remember reading somewhere (possibly on this site) that ionic bonds can be regarded as an extreme form of covalent bonds, where the difference in electronegativity is so great, that the metal gives its extra electrons to the non-metal. Can we assume that the difference in this case is also large enough, such that phosphorus effectively 'gives' away five electrons, therefore reaching neon too? Or am I oversimplifying it?
"ionic bonds can be regarded as an extreme form of covalent bonds." They "can be regarded" as magic, too. What's your point? In what specific context is such regard useful? (I'm not questioning that there may be some specific context that you could regard them that way, rather I AM saying that it is not generally useful.)
 The octet rule is used to predict valence.  Obviously H doesn't obey it. It's quite useful for the chemistry of C,N, O, and F.  But consider ClF5. The Rule is not going to get you there. Nor is it useful, imho, for P4O10 --- but there are ways to bend the meme to "explain" the deviancy. see for example the discussion of hypervalent compounds in https://en.wikipedia.org/wiki/Octet_rule#Hypervalent_molecules. Once you get away from the 2nd &amp; 3rd Period and the 13th - 17th Groups, it shouldn't be relied upon. So, its applicability is limited, but fortunately it's applicability is for a lot of elements which are interesting for us in our environment here on Earth. Since d-orbital (and f-) contributions to hybridizations is generally small, the octet rule is generally useful. What sort of confidence should you have in using it to predict valence? Well, there's two ways to answer this: 1. as applicable to a student learning basic chemistry or 2. as applicable to experts who have in addition to the rule a vast literature on the subject. It is useful for the first and nearly useless for the 2nd.