How to overwrite base controller beforeAction method
Solution is to create a custom controller in a module that extends the cart controller.
This gives the functionality to overwrite the beforeAction method, while keeping all other functionality.

As an example:

&lt;?php

namespace modules\controllers;

use craft\commerce\controllers\CartController;

class FooController extends CartController
{
    public function beforeAction($action)
    {
        // Your overwritten logic here
        $something = 'test';

        return $something;
    }
}


Instead of posting to commerce/cart/update-cart you would then (in the example above) post to  my-module/foo/update-cart. There is some useful documentation in the Craft docs on building a custom module and how to create customer controllers and actions.

[Answered by Nathaniel Hammond Pixel &amp; Tonic]