Long lead helical milling is simple enough using a universal mill and dividing head:

Or on a vertical mill with right angle head for short leads:

For the short lead gear the table feed couldn't drive the table via the speed increasing gear train. So the gear was cut by turning the dividing head and using that to drive the table. Some universal dividing head manufacturers sold short lead attachments. They're nothing fancy. It just means the table leadscrew drives the dividing head spindle directly rather than via the worm and worm wheel. The end of the dividing head spindle is in the middle of the picture above. For short leads one simply drives an expanding arbor in the hole via a gear train directly from the table. Some of the resulting gears:

Although my lathe (4 tpi leadscrew) will cut a 2 tpi thread I chose to use a CNC mill when I needed a 2 tpi worm:

The worms:

In the absence of smartypants equipment I'd be with Rod; use the lathe but using the leadscrew to drive the spindle. Whether one uses a single point lathe tool to cut the thread or a milling spindle would depend upon the thread form. A square thread could use either method but Acme, V or buttress might be simpler with a single point tool.
The problem with Rod's method for cutting a short lead tap is that the milling cutter needs to be larger diameter than the milling spindle so the tap can pass under the milling spindle. Again milling machine manufacturers used to advertise short lead or rack milling heads which had a small diameter to pass over the work while still being able to cut the thread, or rack.
Andrew