The verse is not Proverbs 18:8, but Proverbs 8:8, which states
Proverbs 8:8 (NASB)
8 All the utterances of my mouth are in righteousness;
There is nothing crooked or perverted in them.
The Hebrew word for "crooked" is Hebrew verb פָּתַל, which means "to twist." That is, this word is the Niphal participle, which means "twisted" (or crooked), and is juxtaposed with the Hebrew word עִקֵּשׁ, which is an adjective that means perverted.
The same Hebrew verb פָּתַל now appears again in both 2 Sam 22:27 and Ps 18:26 (identical verses), which now describe the Lord.
2 Samuel 22:27 and Psalm 18:26 (NASB)
With the pure You show Yourself pure,
And with the perverted You show Yourself astute.
The verb form now however is the Hithpael (imperfect), and so the meaning has an intensive reflexive sense, so the verb would mean "contortioning oneself." So the word does not mean "unsavoury" but "twisting oneself." An example will illustrate.
When Rachel and Leah were vying with one another for the favor of Jacob, Rachel used this same verb to describe her struggle with her sister.
Genesis 30:8 (NASB)
8 So Rachel said, “With mighty wrestlings I have wrestled with my sister, and I have indeed prevailed.” And she named him Naphtali.
In this verse, the verb "wrestled" is this same Hebrew verb פָּתַל, and in this verse the verb is in the Niphal (perfect), which here functions not as a passive, but as a reflexive of the Qal when emotions are involved (please click here). So Rachel is literally saying that through a gargantuan struggle with her sister, she was adept (by playing the Bilhah card, by whom she had two children), and therefore she prevailed, which is why she named her second son "Naphtali" (which means "my wrestling"). In other words, Rachel had to best Leah, and so she used her maid Bilhah to bear sons to Jacob, but when Leah caught on, she too leveraged her own maid Zilpah to bear yet more sons to Jacob. The point here is that the Hebrew verb פָּתַל does NOT refer to literal twisting of body in the act wrestling, but of outsmarting the opponent through adept cunning (thus the idea of twisting).
So, in other words, the idea in 2 Sam 22:27 and Ps 18:26 is not that the Lord is "unsavoury" or "twisted" (as the original question of this posting had alluded), but that like Rachel, the Hebrew verb is self-acting (reflexive), which means that the Lord adapts himself so as to thwart the cunning of the wicked. Thus the translation of "astute" in the NASB of 2 Sam 22:27 and Ps 18:26 would be an appropriate translation of this Hebrew verb in context.