See, here we go again with the specialized weaponry considerations.
The original question was what should you buy as your first self defense firearm?
The answer, to me, seems obvious, especially given that for more than a few buyers, perhaps even the majority, that first firearm will be the only one they buy.
Which means it needs to be a handgun. Can a handgun perform adequately as a home defense weapon? Of course it can, for the sort of home defense most people will ever need.
Can it perform as a carry weapon? Of course it can, where a long gun can not, generally speaking.
Can you train with a handgun in more places than a long gun? Of course.
Is it in general cheaper to by ammo for a handgun than a long gun? Yes, for most calibers. (Spare me the .22 yadda yadda, please).
Can you grab and fire a handgun with one hand? Sure. Not so easy with a long gun.
Are handguns generally less expensive to purchase than long guns? Yes.
All of this seems to me to militate in the direction of a handgun as a first purchase.
That said, I am as "specialized" as most serious preppers, with a variety of hand and long guns within easy reach, all purchesed with different (to some extent) roles in mind. But my first purchase as an adult, with the purpose of self defense in mind, was a pistol. A short barreled .38 revolver, in fact, which I still own and shoot regularly.