How to get Plugin Slugs?

I am hoping there is a better way

You can write your code a bit better, like adding some protection should something fail in your function. One should never take code for granted that it will always work, even if looks like it. Always code with the mindset of that your code will fail.

I will just simply do a foreach loop and then pass the keys through basename will return everything after the last / if it exists and will also remove the .php extension.

As for get_plugins(), that is definitely a good option to go with as it utilizes the build-in cache system to cache it’s results

I would probably rewrite your code as follows; (Requires PHP 5.4+)

function l7wau_get_slugs()
{
    $plugin_array = get_plugins();

    // First check if we have plugins, else return false
    if ( empty( $plugin_array ) )
        return false;

    // Define our variable as an empty array to avoid bugs if $plugin_array is empty
    $slugs = [];

    foreach ( $plugin_array as $plugin_slug=>$values ){
        $slugs[] = basename(
                $plugin_slug, // Get the key which holds the folder/file name
                '.php' // Strip away the .php part
            );
    }
    return $slugs;
}

Will this work for all plugins?

Yes, it will work for plugins in the plugin directory. get_plugins() uses get_plugin_data() which parses the plugin header data to retrieve the meta data. Just look at the sources included in the links.