On December 30, as we eagerly await New Year celebrations, event organizers need to quickly generate URL-friendly slugs from event names. A slug is a simplified version of a string that is lowercase, punctuation-free, and uses hyphens to separate words.
Write a function that takes an input string and returns its slug following these rules:
You can assume the input string is non-empty.
Input: "New Year's Bash 2024!"
Output: "new-years-bash-2024"
Input: " Welcome_to_The New Year Gala!!! "
Output: "welcome-to-the-new-year-gala"
Write your solution in any programming language of your choice.