This idea for making square pegs popped into my head when cutting grooves for a drawer bottom.
I had used my plow plane, so there were square-shaped holes in the back of the drawer that needed to be plugged.
That's when I spied an offcut from a drawer side. The thin piece of wood beneath the groove was essentially half the shape I needed.
So I grabbed my plow plane**, dialed in a 1/4" width and depth, plowed an edge of a scrap piece of wood, laid the board on its side, and plowed a groove on the face.
Well, I'll be darned. It worked like a charm. I had a perfectly square 1/4" peg.
This method does require a plow plane, but based on the idea, you might find another tool that will work equally as well.
And as you approach the 1/4" depth on the second groove, the peg will want to tip down because it's no longer supported beneath the cut.* Keep your hand tight against the plow plane's fence to ensure that the peg stays in position.
The peg will snap off when you're very close to the bottom of the second groove, and you may have a tiny sliver of wood that can be removed with a chisel, but this is the easiest way I've found to make perfectly square pegs by hand.
*If you need to make a bunch of pegs on a regular basis, you could make brass spacers that fit into the first groove which will then support the second cut. You can use the same spacers to set up your plow plane.
**For those who are interested, I have a Lee Valley Veritas plow plane. I do not benefit in any way from the sale of their tools.