Returning an array to Twig from a plugin
Your plugin should be able to handle PHP arrays just fine.

craft/plugins/myplugin/variables/MyPluginVariable.php

function getArray()
{
    return array('hi', 'there');
}


craft/templates/template.twig

{% set result = craft.myPlugin.getArray() %}
{% for item in result %}
    {{ item }}
{% endfor %}


The error you're seeing is likely because output itself is an array. If you have devMode enabled you can try a {{ dump(output) }} inside your for-loop to see what it actually is / contains.