Set the in-line style for both the id="s4-statusbarcontainer" and id="s4-ribbonrow" div's to style="display:none". Then somewhere appropriate below both elements in the master page insert the following:
<Sharepoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl" runat="server" PermissionsString="AddAndCustomizePages">
<script type="text/javascript">
document.getElementById("s4-statusbarcontainer").style.display = "block";
document.getElementById("s4-ribbonrow").style.display = "block";
</script>
</Sharepoint:SPSecurityTrimmedControl>
This will cause the ribbon and status notification to be rendered by the browser yet be hidden so the page will still operate normally. If the user is authenticated and allow to modify pages it will render the JavaScript to override the hidden style.
[courtesty of Rich Krott]