Short spear a.k.a. half-pike a.k.a. spontoon.
They were used in the Revolutionary War, carried by members of the Lewis & Clark expedition, etc. Later they evolved more to ceremonial use in the military and eventually phased out.
https://military.wikia.org/wiki/Spontoon
Kenneth Kramm is a gentleman with several Youtube videos on historical camping. In at least one of his videos, he discusses the spontoon. His modern version was a Cold Steel Bushman knife on the end of his walking stick, same as was mentioned previously. FWIW yes the Bushman still has a fastening hole near the end of the folded grip section.
Cold Steel makes an actual spontoon... as well as several other spears e.g. American hunting spear, boar spear, Assegai and MAA classic leaf shape.
Packing something like that nowadays might raise some eyebrows. I'd at least get one with a sheath, or make a sheath.
My favorite would be the regular length Assegai spear. I'd never pack such a thing around. Firstly, I'd feel like a real dork (nothing new, maybe, but still). Secondly, I am a clod. I'd probably trip, cut myself and bleed out on the trail.
I'd also check local laws before packing a double edged, "fixed blade" spear.
As for actually using one defensively, it's enough out of the mainstream (so to speak) that it's almost a guarantee of a write-up in the local news and an opportunity for the prosecuting attorney to paint the spear wielder as some sort of nut job "weapon fanatic". Which is why we have stuff like shillelagh and similar sturdy walking sticks.