All these are OK and mean the same thing.Even if you are ill, don't take more medicine than is necessary.
Even if you are ill, don't take more medicine than necessary.
Even if you are ill, don't take an unnecessary amount of medicine.
However, be aware that saying "don't take too much medicine" may not necessarily suggest the exact same thing. If you "take too much medicine," the suggestion may be that you take an amount that not only is more than necessary, but an amount that is actually detrimental in some way. Saying "don't take more than necessary" doesn't necessarily suggest this. It's more like suggesting that there's no point in wasting medicine. The difference is subtle, but it's there.
Hope this makes sense.