The story
Named after a nearby river, Sungai (“river” in Malay) Slim, itself named in the 19th century after the English captain William Slim, who accidentally went up the river instead of the Perak River which was the main waterway back then.
Etymology from Wiktionary, CC BY-SA 4.0.