Under its entry for handle, the OED defines to get a handle on, as ‘to gain control over . . . to acquire the means of understanding or of forming an opinion about’ and the earliest citation in support is as late as 1972 from the ‘New Yorker’:
Scribner . . . said to me, ‘I don't think people have any idea of how
tough it is for anyone in this job to get a handle on anything.’
However, under the entry for get, there is this citation from Charles Kingsley’s ‘Hereward’, published in 1865:
Driving them mad and desperate just that you may get a handle against
them.
That doesn’t seem to have quite the same meaning as the ‘New Yorker’ citation, but if you’re looking for first use . . .
The original terms goofy-foot and goofy-footers (later shortened to goofy) appear to have become popular in surfing during the early sixties. I agree with FumbleFingers: it's likely both the surfing term and Disney's Goofy character comes from the earlier goofy meaning of stupid, silly, daft.
In fact, after watching the 1937 Disney animation Hawaiian Holiday, Goofy surfs with whichever foot forward makes him face us. He attempts to surf three times. The first two are unsuccessful and he can't stand up on the board. The third time is (more) successful: first he surfs left-foot forward (regular stance) towards the right, so his body is facing us. Then he turns and surfs right-foot forward (goofy stance) towards the left, again so his body is facing us.
The earliest instance I found in print is Desmond Muirhead's 1962 Surfing in Hawaii: a personal memoir:
People who put their right foot forward are called 'goofy foots'.
2007's The Concise New Partridge Dictionary of Slang and Unconventional English agrees with 1962:
goofy foot noun a surfer who surfs with the right foot forward. Most surfers surf with their left foot forward. AUSTRALIA 1962
A 1963 Paradise of the Pacific magazine defines some surfing terms:
As or the language, it is probably altogether as intelligible to the unpractised ear as Kurdish might be in Kansas City. In the lexicon in use by the cult, a surfer is a cork top, beginners are gremlins or kooks, a loudmouth a hodad; a goofy foot, a strange type; a hot dogger, an expert.
A May 1963 Billboard picks out Shean and Jenkins with their Goofy Footer Ho-Dad single (listen on YouTube) as a winner in their novelty spotlight of the week, selected for "potential to become top sellers".
Two very funny sides that could attract play and sales. ... Flip is somewhat on the surf kick with a sort of beatnik poeatry narrative. Funny material, well carried off.
A June 1963 Billboard magazine lists a record by The Lively Ones called Goofy Foot as a four-star single (listen on YouTube).
The four-star rating is awarded to new singles with sufficient commerical potential in their respecitive categories to merit being stacked by dealers, one-stops and rack jobbers handling that category.
These show the term was becoming more popular and widespread.
An early etymology is suggested by the 1970 Studies in English by the University of Cape Town's Department of English says:
Surfers who have a right foot forward stance are known as goofy-footers, or simply goofy surfers. This is doubtless derived from the older American expression "goofy", which means "ridiculous, silly, . . . nutty".
Best Answer
Get lost! dates from at least 1944 in popular media, and in speech is likely to pre-date this somewhat.
1945
Here's a 1945 in the script for Anchors Aweigh! by Isobel Lennart, also a 1945 film:
1944
It shows up in Billboard, 15 April 1944:
Snippets of I Never Left Home (1944) by Bob Hope (snippets can have incorrect metadata, but this seems correct):
And from the same book, perhaps literal, but perhaps a Bob Hope half-joke:
Another possible 1944 is in Best stories of modern Bengal, Volume 1 by Dilip K. Gupta:
1942
"Let's Get Lost", a torch ballad by Frank Loesser and Jimmy McHugh (sung here by Lina Romay, but also by Jimmy Dorsey, and by Mary Martin in the 1942 film Happy Go Lucky, and later by Frank Sinatra), was popular in 1943 and often in Billboard's top ten. It goes:
Although not directly using the imperative idiom, I think it's suggestive of it and likewise helped popularise it.