Does the phase "what's an honest man to do?" have a specific literary origin, or is it simply a common-usage rhetorical question?
Solution 1:
Disconcertingly, the earliest expressions I've been able to find (through a Google Ngram search) that focus on what an honest man is to do occur in Parliamentary proceedings. The earliest example that addresses the general notion of doing what an honest man is to do is this one, from a speech by the Lord Protector (Cromwell) at a Whitehall conference on monarchy on April 9, 1657, in John Somers, A Collection of Scarce and Valuable Tracts, volume 2 (1750):
In all things a Man is free to answer Desires, as coming from Parliaments : I may say that in as much as the Parliament hath been pleased to condescend to me so far, to do me this Honour, a very great one added to the rest, to give me the Advantage of so many Members of theirs, so able, so understanding the Grounds of Things ; it is I say, a very singular Honour and Favour to me ; and I confess, I wish I may, and I hope I shall do what becomes an honest Man to do, in giving an Answer to these Things, according to the Desire, that either I have, or God shall give me, or I may be helped by reasoning with you into ; [sentence truncated, as it goes on and on and on].
The earliest occurrence of the exact phrase "what is an honest man to do" in the same search results involves a speech by Lord Mansfield in a Parliamentary debate over the "American prohibitory bill," from (as nearly as I can tell) December 18, 1775, reported in The Scots Magazine (February 1776):
They [the Americans] are preparing a naval force to carry on an offensive war against you. In this state of the case, for God's sake, my Lords, what is an honest man to do, who is a well-wisher to the honour and interest of Great Britain? Are we to sit still with our hands before us, because we are told this is an unjust war on our part, till they have fitted out an expedition against this country?
The next-earliest occurrence in those search results is from Parliamentary Debates (July 9, 1782), where a Mr. Fox uses the past-tense form of the phrase:
To bring them [members of his Majesty's Council] unanimously to some such specific and decisive point, he had labored ardently and assiduously, both individually and collectively considered, but all to no purpose. What was an honest man to do, who found himself situated as he was? He had avowed principles in this place to his friends, to his constituents, to the nation at large, with which he deemed their existence, as a great and a respectable state, inseparable.
Though Parliament (or Congress, for that matter) wouldn't be my first choice as a source of practical advice on what an honest man ought to do, I'm not entirely surprised that speakers there would be among the first to raise the plaintive, rhetorical question, "What is an honest man to do?"—nor that Lenin, after shearing the question of its insistence on the hypothetical man's honesty, would reformulate it as "What Is to Be Done?"
Solution 2:
If the sense of the expression is meant to be one of exasperation, the book, The Italians, by Luigi Barzini provides this quote by D.H. Lawrence from a letter to Lady Cynthia Asquith in 1913:
I loathe and detest the Italians. They never argue, they just get hold of parrot phrases, shove up their shoulders and put their heads to one side, and flap their hands. And what is an honest man to do with them?