Force download string as text file
I ended up making some modifications to the Drupal CSV module (code). The module code demonstrates that you can stream information directly to the client with header() designations. From what I was able to find, you aren't able to use form headers within form callbacks. An alternative method involved passing information with sessioning to an empty page (that doesn't have header restrictions). This had several undesirable consequences:

1.) Session information is saved temporarily server-side, increases time to load to client due to having to write twice.

2.) Finite memory allotment for sessions.

The solution below does not have these limitations:

&lt;?php

function test_download_form($form, &amp;$form_state) {

  $form['form_wrapper'] = array(
    '#prefix' =&gt; '&lt;div id="form_wrapper"&gt;',
    '#suffix' =&gt; '&lt;/div&gt;',
  );

  $form['form_wrapper']['download_submit'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; 'test download',
    '#name' =&gt; 'retrieve',
  );

  return $form;
}

function test_download_form_submit($form, &amp;$form_state) {
  $characters = 'ACGT';
  $randomString = '';
  $n = 50000000;

  for ($i = 0; $i &lt; $n; $i++) { 
    $index = rand(0, strlen($characters) - 1); 
    $randomString .= $characters[$index]; 
  }

  //https://git.drupalcode.org/project/csv/blob/7.x-1.x/csv.module
  drupal_add_http_header('Content-Type', 'text; charset=utf-8');
  drupal_add_http_header('Content-Disposition', 'attachment; filename="test_header_method.txt"');
  $fp = fopen('php://output', 'w');
  fwrite($fp, $randomString);
  fclose($fp);
  drupal_exit();
}