SVG favicons are the newest option and they solve several problems at once: they scale to any size without blurring, they can respond to dark mode, and they are often smaller than equivalent PNGs. Safari added SVG favicon support in March 2024, making SVG viable everywhere.
Add <link rel="icon" type="image/svg+xml" href="/favicon.svg"> to your head. Provide a PNG fallback for old Safari versions. Use genfavicon.org to generate both SVG and PNG favicons from any image or text.