get_posts()
can receive an argument describing which post status to operate. I would say something like this:
function remove_all_kba_data(){
//remove articles
$articles = get_posts(
[
'post_type' => 'kb_kba',
'posts_per_page' => -1,
'post_status' => [ 'published', 'draft' ]
]
);
foreach( $articles as $article ) {
//delete post, bypass trash
wp_delete_post( $article->ID, true);
}
}