"one who eats and drinks to excess," early 13c., from Old French gloton "glutton;" also "scoundrel," a general term of abuse (Modern French glouton), from Latin gluttonem (nominative glutto) "overeater," which is related to gluttire "to swallow," gula "throat" (see gullet). General sense in reference to one who indulges in anything to excess is from 1704. Glutton for punishment is from pugilism; the phrase is from 1854, but the idea is older:
Thus, Theocritus, in his Milling-match, calls Amycus "a glutton," which is well known to be the classical phrase at Moulsey-Hurst, for one who, like Amycus, takes a deal of punishment before he is satisfied. [Tom Moore, "Tom Crib's Memorial to Congress," 1819]