It depends on how the form is created. If you create it directly, you can just do:
form = SQLFORM(..., _style='...')
If it's an Auth form, you can't do that, but if you don't specifically need to use the form.custom items to create a custom layout, you can do:
form = auth.login()
form['_style'] = ...
If it's an Auth form and you need to use form.custom.begin, then the best option is probably what you have done. Anway, doing:
<form action="#" enctype="multipart/form-data" method="post" style="...">
isn't much more difficult than doing:
{{form.custom.begin['_style'] = '...'}}
{{=form.custom.begin}}
I suppose another option would be:
{{=str(form.custom.begin).replace('>', ' style="...">')}}
Though just typing out the raw HTML is just as easy and probably more straightforward.
Anthony