If you have the same baseUri for all your tokens you can create that function yourself and store it in your own contract.
You have to overwrite it. That's why it appears as "virtual" in the contract ERC721
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overriden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
Since you override it you can create the setBaseUri function yourself.
You're looking at the docs for 2.x (see the URL), but the latest version is 4.4! The way base URI is defined now is by overriding the function as shown by @cainuriel.
This doesn't just happen to you guys. Even web3.js, their old docs often ranked high on Google.
I'd suggest, since blockchain tech evolves so rapidly, have a vivid note on top as you said or put them in a separate URL with the word like "archive" or something to differentiate older versions. Or use the word "latest" in the URL for latest ver. Google is smart these days.