Are there words in the German language where
Abcde are both valid words but they get pronounced slightly differently? Maybe words that are stressed differently? Is there any case where the capitalion has an effect on the pronunciation?
Except from the example "Weg" there is no common such pair.
However, capitalising things works as an emphasizer, and that does affect pronunciation somewhat; it might be slower, more majestic, etc.
Douglas Adams, Dirk Gently's Holistic Detective Agency:
The door was the way to... to... The Door was The Way. Good. Capital letters were always the best way of dealing with things you didn't have a good answer to.
This effect works just the same way in German:
Die Tür war Der Weg.
This would certainly affect the pronunciation of the articles, when compared to their normal pronunciation.
If there are words that differ solely by capitalisation and pronunciation, they are very few. Apart from Weg and weg I cannot think of any.
In fact, homographes that aren’t homophones (so words that are written the same but not pronounced the same) are extremely rare in German. Short vowels are typically marked by a double consonant (and/or a consonant cluster) following. Long vowels are either unmarked, marked by doubling or by h (or e). Only for a set of very short words (often with grammatical function, according to the official rules) can the vowel be short and the final consonant undoubled.
Only if one of those short words which has a short vowel but no double consonant accidentally is written the same way as a different word that has a long vowel and if one of the two words is a noun will they accidentally have different pronunciation but differ only in capitalisation (since nouns are always capitalised).
Stress is not affected by capitalisation and shifted stress is usually also indicated by shifted length marking. So the Weg/weg case is very special.