Devoicing 'Voiced consonants' to their counterparts

Solution 1:

This is more or less correct, but in most of your examples a native English speaker doesn’t hear these as their voiceless counterparts because the preceding vowel is longer than it would be if the consonant was its "voiceless" counterpart.

“I have two” = [a͡ɪː hæːf tu]; it’s not pronounced the same as “I haff to”, where the middle vowel would be short (or “clipped”).

English "voiced" plosives /b d g/ (and the affricate /d͡ʒ/) tend to be most strongly voiced when they are between two other voiced sounds—vowels, semivowels, or sonorant consonants such as /l r m n/—and least strongly voiced when they are next to voiceless obstruents such as /p t k tʃ s ʃ f θ/. (I think it is impossible for "voiced" plosives to be surrounded on both sides by voiceless obstruents.) However, the exact degree of voicing given to these sounds varies between speakers. The key things that differentiate /b d g/ from /p t k/ are that /p t k/ are aspirated at the start of a stressed syllable, and that vowels are "clipped"--which means that they are phonetically shorter--before a "voiceless" phoneme.

Transcription notes

Some people don’t like to transcribe the consonant found in contexts like "have two" with the symbol “f” because even though it is voiceless (or mostly voiceless), it is also “lenis”, a vague word that I think in the context of voiceless fricatives is mostly related to the length of friction ("lenis" fricatives are shorter than "fortis" ones). Rather, they transcribe it with the "v" symbol along with a "voiceless" ring diacritic: [v̊]. So "I have two" would be something like "[a͡ɪː hæːv̊ tu].

The difference in pronunciation between "vegetable" and a hypothetical "vetchtable" isn't as obvious to me, maybe because this is a polysyllabic word, or maybe because the consonant involved is /d͡ʒ/. Nonetheless, I would recommend pronouncing vegetable as [ˈvɛːd̥͡ʒ̊təbl̩] rather than as [ˈvɛt͡ʃtəbl̩].

Special circumstances where a voiced fricative is truly replaced with its voiceless counterpart

There are a few special phrases where a historically voiced fricative is truly turned into its "voiceless" counterpart phoneme. One of these is "have to", in the sense "must". This is pronounced the same as "haff to" for many speakers, with /f/ instead of /v/. We also see this with /s/ instead of /z/ in "has to", "used to" and "supposed to". And I've heard that this can occur for some speakers inside some historically compound words, such as "newspaper": Merriam-Webster lists a pronunciation with /s/ as well as a pronunciation with /z/. But these are exceptions, not the rule.