How do you know your 'export_for_template' is not actually being called but not using your template?....
But then in 'outputrenderers.php' there is:
/**
* Renders the login form.
*
* @param \core_auth\output\login $form The renderable.
* @return string
*/
public function render_login(\core_auth\output\login $form) {
$context = $form->export_for_template($this);
// Override because rendering is not supported in template yet.
$context->cookieshelpiconformatted = $this->help_icon('cookiesenabled');
$context->errorformatted = $this->error_text($context->error);
return $this->render_from_template('core/loginform', $context);
}
so no autoloading but fixed class names and specifically located template. Which if I'm wrong and the class you have is autoloaded, will still mean that the template is not yours so the additional context data will be unused.