Completely, entirely, thoroughly, sharp, definite. “She sliced through the apple, clean as a whistle.” Leaving no ragged edges or trailing peel, presumably. The phrase may have replaced the 18th-century “clear as a whistle,” which alluded to the pure, clean sound of a whistle, which has few overtones and can be heard in a noisy environment.
Human beings are generally good whistlers, and producing a clear, pure musical sound by blowing through one’s pursed lips may be humanity’s oldest musical skill, though I would guess that drumming may be nearly as old. The word “whistle” is ancient, and was formed in imitation of the sound of whistling itself.
There are various suggestions as to where the simile originated. It may perhaps describe the whistling sound of a sword as it swishes through the air to decapitate someone. An early 19th century quotation suggests that connection: “A first rate shot, [his] head taken off as clean as a whistle.” Clean as a whistle has a nearly universal association with cuts. Clean cuts are not ragged but are smooth with crisp sharp edges.
It also might mean the slippery smooth surface of a willow stick debarked to make a whistle. Another suggestion is that the phrase may have originally been “as clean as a whittle,” referring to a piece of smooth wood after it is whittled. (From the “Encyclopedia of Word and Phrase Origins” by Robert Hendrickson, 1997)
As any whittler worth his whistle can tell you, a good whistle made from a reed or a piece of wood emits a clear tone — but is easily damaged. Even small particles of debris, or a few drops of moisture will change the sound of a handmade instrument. In order to emit pure notes, a whistle has to be absolutely clean. So it follows that anything or anyone as clean as a brand-new whistle or as clear as its sound is bound to be good. All of which means that an organization or person called as ‘clean as a whistle’ has been judged to be guiltless or flawless.
Yet another suggestion is that the phrase was related to locomotives where the brass, especially the whistle, was always bright and gleaming.
I don’t know which is the most probably explanation. I’ve never whittled a whistle, and haven’t whistled a tune since I was a kid and drove my mother crazy with repetitions of You Are My Sunshine. Only trying to get it right, you understand!