However whatever I have tried to do, I cannot make the popover menu of the dropdown compact. I want it to look as compact as possible, preferably similar to how the above CSS makes a dropdown look
You may need to be stylingdropdown > popover, not > button - if you want to affect the popover, not the button. Maybe having the properties on the button can work in some cases, but you might also need to be explicit, to e.g. override your system theme.
You may need to look into what the default theme does, so you can apply enough CSS priority of your own to override it. You may also need to look into overriding other properties, e.g. border-spacing.
Without a definition of your exact widget tree, and what you do / don’t consider “compact”, it’s hard to say further.