I am writing a macro with many arguments, many of which may be optional. Example of how I imagine it:
\newcommand{\mycommand}[width, height, density=1, joy=0]{Only \texttt{width} of value #width is used.}
\mycommand[width=10, joy=-1, height=2]
I know that LaTeX supports optional arguments, but I can't refer to them by name, what in more complicated macros is a great deal for readability. Also, if I want to remove an argument from the middle, I would need to renumerate all arguments used in the macro's body, which is a pain.
What are the most convenient and sensible ways to accomplish this? I prefer a LaTeX solution, but I can switch to another engine if it would significantly improve the experience.

keyval. – AlexG Feb 15 '22 at 14:30pgfkeys:) – Joseph Wright Feb 15 '22 at 15:03