- It is repetitive in the sense that it’s repeated for each script that you might execute from the command line.
- If you put your main code in a function like this, you can import the module without executing it. This is sometimes useful. It also keeps things organized a bit more.
- Same as #2 as far as I can tell
- Python is generally pretty good at avoiding boilerplate. It’s flexible enough that in most situations you can write code to produce the boilerplate rather then writing boilerplate code.
Off topic question:
If you don’t write code to check the arguments, they are ignored.