cv (https://github.com/civicrm/cv) provides helpers for running PHP code via CLI. For example, to run a single line of PHP code, you might say:
cv ev 'CRM_Core_I18n_Schema::rebuildMultilingualSchema(array(...), NULL);'
The snippet you posted involves a variable
$locales which isn't defined here. If you know the intended content (e.g. maybe
array('en_US')) then you could plug that in directly.
Alternatively, maybe you could call that particular upgrade function
addHelpPreAndHelpPostFieldsPriceFieldValue() directly. (This is not always going to work; it's a case-by-case judgment looking the substance of the function.) If it's appropriate, then:
cv ev '$u = new CRM_Upgrade_Incremental_php_FourSeven(); $u->addHelpPreAndHelpPostFieldsPriceFieldValue(NULL);'
More generally, you could copy the desired code out of
CRM/Upgrade/Incremental/php/FourSeven.php and put it in a new file (
my-upgrade-fix.php). Hack the code as desired and then run:
cv scr my-upgrade-fix.php