The modern sense has been around since the 13th century; but later medicine began to be used for drugs which had other purposes, such as cosmetics, poisons, elixirs, and potions. Shakespeare has the original meaning when Friar Laurence draws a contrast between an effective remedy and its harmful opposite: "Within the infant rind of this weak flowerPoison hath residence, and medicine power" (Romeo and Juliet, II.iii.20). But when Falstaff grumbles about his association with Poins, saying "If the rascal have not given me medicines to make me love him, I'll be hanged" (Henry IV Part 1, II.ii.18), the word means "love potion". And when Gonerill hears that her sister Regan is very ill, and says to herself, "I'll ne'er trust medicine" (King Lear, V.iii.97), she is being ironic (having just poisoned her). Medicine is the Folio reading; the Quarto text is unambiguous: poyson.
David Crystal is author, with Ben Crystal, of Shakespeare's Words, published by Penguin