Getting a PhD is a great idea (I'm doing one right now), but doing it straight away seems to me a bit like ordering off a menu without going past the first page.
From what I've read in the sociological/psychological literature that trickles to the general reading public, being overwhelmed with choices often leads to higher dissatisfaction with any choice than picking from a handful of good choices.
Now, OP, that doesn't mean that I think you should ignore the menu entirely and just order grilled cheese, but I do think you should be careful of getting sucked into exploring a bazillion choices in fear of settling only to end up a broke nomad at 35. I've seen far more people end up in that situation than I've seen STEM graduate school people who regret their time in graduate school. I know lots of STEM folks who left graduate school to go work in something unrelated to their graduate program, but graduate school isn't some horrible thing that will mark you forever as unfit for being with normal folks.
In summary, don't just go with the one thing you know now, but you also don't have to make sure you've explored every possible other choice before going to graduate school, either.