If you modify the prevalence of your training set (thereby the prevalence of your CV partitions for model evaluation and selection) you essentially change how the model fits your data (e.g. internally minimizes the error of the fit). This could both cause be beneficial for your goal, or be degradation - that depends on the details of your problem and goal. If you do so, the one important thing is to not modify the prevalence of your held-back test set.
To give an example: if there are unbalanced classes and the model fits data in a way that the positive, less prominent class is badly predicted (bad TPR but good TNR), and you can't change this using hyperparameters, this could likely still be changed e.g. by down- or upsampling, weighting of samples, etc. The internal change is that thereby the less represented samples each contribute a bigger part to the error during fitting, hence how the model fits and represents data.
Besides changing how models fit the data, as you pointed out, one could change the error measure, which largely depends on what you want to achieve. This can be beneficial if you are evaluating and selecting one model from multiple candidate models. For example, using TPR and TNR (+ ROC AUC etc.) boils down to optimizing for correctly predicting samples as positive P samples, if they are actually P - as well as negative N samples, if they are actually N. This essentially leaves out class prevalence (e.g. many false positives don't degrade true positives or false negatives). In contrast, precision and recall (+ precision-recall ROC) look at the same ground information differently, as false positives directly influence both recall and precision.
So, bottom line: it depends on what you want to achieve. There are problems/approaches out there that use artificially manipulated training prevalence to change how the model represented training data - e.g. better representing certain classes - which in turn better satisfies predefined goals. But, as pointed out in the beginning, it's important to not change the prevalence of your final test set, because this one reflects the TPR, TNR, precision, recall, and whichever other metric you look at for the final model on data with (hopefully) natural prevalence.