Redefine core Kirby class

Is there native a way to redefine core Kirby classes, specifically the UsersAbstract and UserAbstract classes?

Am currently working on a project with 5,000+ users, and am considering adjusting the way users work to store in a small database vs flat files (as expected things get pretty slow with this many files). Wondering if there is a decent way of doing this aside from directly modifying the core (or monkey patching).

What you could try is to load a PHP file with your classes in the index.php before Kirby is loaded:

<?php

define('DS', DIRECTORY_SEPARATOR);

// load custom classes
require_once(...);

// load kirby
require(__DIR__ . DS . 'kirby' . DS . 'bootstrap.php');

// check for a custom site.php
if(file_exists(__DIR__ . DS . 'site.php')) {
  require(__DIR__ . DS . 'site.php');
} else {
  $kirby = kirby();
}

// render
echo $kirby->launch();

The way the autoloading is implemented, PHP should then pick up your classes instead of loading the original Kirby ones.