You understand the situation (that dpi number does not affect the pixels), and in this situation (before considering actually printing the image), always setting 300 dpi is a good politically correct action that will please those that don't understand what it means (or doesn't mean). Digital image size is specified by dimensions in pixels, not by inches.
Video screen applications (computer monitors, phones, TV, etc) pay no attention at all to the dpi number, since inches have no meaning to video systems. Because video screens are dimensioned in pixels, and they show pixels, and inches are of no concern.
Photo paper is dimensioned in inches, but if you send the image to a print shop and specify 8x10 inches, they will print it 8x10 inches, and will compute their own necessary dpi number to do it. They will necessarily ignore any dpi number it already says. They do what they have to do.
The 300 dpi number will only be used by users clicking the Print menu at home WITHOUT doing any other size altering decisions. But everyone knows we have to instead make it fit the paper.
The shops and editors that demand "300 dpi" (without specifying print size to determine necessary pixels) are just trying to poorly say they want lots of pixels, possibly as explaining to users that don't know what dpi means anyway. They should be smarter, and explain the actual requirements.
Assuming a 6000x4000 pixel image, then 300 dpi simply means it will say 20x13.3 inches. Meaning, it is a large image. Conveys something different than if it said 3x2 inches. But we all know we will have to make it fit the paper. We have to know the paper size to do that.
dpi in images is an arbitrary number, normally always ignored, but 300 dpi is as good a number as any. 300 dpi is less likely to confuse those that don't know it does not mean anything yet.
Setting dpi is quite important to scanners, to determine the resolution of the area they scan.
But digital camera sensors are each a fixed resolution, and cameras originally did not put the dpi number into their images, because they knew dpi has no meaning until we decide the size we wish to print. But Adobe (Photoshop) has the notion to show missing or blank dpi numbers by instead making up and showing a false 72 dpi number (monitor screens used to be near 72 dpi resolution, back in the day). But camera sensors became much larger, and this false 72 dpi override caused the print size to show a few feet size, instead of just letting it be blank or unknown. So in defense, cameras had to start including a dpi number, maybe 180 or 240 dpi, arbitrary, but more than 72 dpi, so that Adobe would not show a ridiculous default print size of a few feet. That tends to make us think the dpi number has some meaning, but of course, it does not (not until we actually print it, when of course, we then do what we have to do, which today often involves resampling smaller).