In a large pot, combine onion, shiitakes, ginger, oil, cardamom, star anise, cinnamon, and cloves. Cook over medium-high heat, stirring occasionally, until onions are charred and spices are fragrant, 4 to 5 minutes.
Add stock, miso, soy sauce, and palm sugar. Cover, increase heat to high, and bring to a boil. Cook until slightly reduced, about 4 minutes. Reduce heat to low, cover, and simmer, stirring occasionally, until onion is translucent, 18 to 20 minutes.