In Raymond Chandler’s novels Philip Marlowe (who is a very good man who needs to pretend to be hard) uses the phrase ironically all the time. That’d be '40’s and '50’s (and even the late '30’s, although I don’t recall him using it until later in the oeuvre). I don’t know if the phrase came from Chandler, but he may have helped popularize it.
–Cliffy